]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pd: don't reverse flow if TCP session not midstream
authorVictor Julien <victor@inliniac.net>
Mon, 2 Sep 2019 08:25:30 +0000 (10:25 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Sep 2019 17:11:12 +0000 (19:11 +0200)
src/app-layer.c

index 1fe34e5bfa6aa4580661684e973276c77a0d04bc..ebd91158e840235d41370cadefb531102193bc8b 100644 (file)
@@ -358,7 +358,7 @@ static int TCPProtoDetect(ThreadVars *tv,
         /* if protocol detection indicated that we need to reverse
          * the direction of the flow, do it now. We flip the flow,
          * packet and the direction flags */
-        if (reverse_flow) {
+        if (reverse_flow && (ssn->flags & STREAMTCP_FLAG_MIDSTREAM)) {
             SCLogDebug("reversing flow after proto detect told us so");
             PacketSwap(p);
             FlowSwap(f);