flow/timeout: fix TCP seq/ack for reversed flows

When a flow is swapped it also swaps the stream trackers, so it does
not make sense to reverse them during pseudo packet creation.

(cherry picked from commit 49bd1f85b9)
pull/5679/head
Victor Julien 6 years ago
parent 82e10f2cdd
commit 916edf2e2e

@ -80,6 +80,7 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
Flow *f,
TcpSession *ssn)
{
const int orig_dir = direction;
p->tenant_id = f->tenant_id;
p->datalink = DLT_RAW;
p->proto = IPPROTO_TCP;
@ -217,7 +218,7 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
p->tcph->th_urp = 0;
/* to server */
if (direction == 0) {
if (orig_dir == 0) {
p->tcph->th_sport = htons(f->sp);
p->tcph->th_dport = htons(f->dp);

Loading…
Cancel
Save