From: Victor Julien Date: Wed, 20 Mar 2019 15:38:56 +0000 (+0100) Subject: flow: on timeout, consider reverse flows for pseudo packets X-Git-Tag: suricata-5.0.0-beta1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f1ace64c6f9c4f00f7960037ac508c09ddd7546;p=thirdparty%2Fsuricata.git flow: on timeout, consider reverse flows for pseudo packets --- diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 5c34d6fc5e..4fde34b952 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -104,6 +104,9 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p, p->payload = NULL; p->payload_len = 0; + /* apply reversed flow logic after setting direction to the packet */ + direction ^= ((f->flags & FLOW_DIR_REVERSED) != 0); + if (FLOW_IS_IPV4(f)) { if (direction == 0) { FLOW_COPY_IPV4_ADDR_TO_PACKET(&f->src, &p->src);