]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Bug 1401: on midstream pickup, fix packet direction 1383/head
authorVictor Julien <victor@inliniac.net>
Tue, 17 Mar 2015 10:48:17 +0000 (11:48 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Mar 2015 10:48:17 +0000 (11:48 +0100)
On midstream SYN/ACK pickups, we would flip the direction of packets
after the first. This meant the first (pickup) packet's direction
was wrong.

This patch fixes that.

src/stream-tcp.c

index 28ef48f7553ae6272b4f96b63a2978c3e53da694..d414186bf87d24acf8ec3f11552d90ee77b8bd02 100644 (file)
@@ -913,6 +913,9 @@ static int StreamTcpPacketStateNone(ThreadVars *tv, Packet *p,
                     "SACK permitted for both sides", ssn);
         }
 
+        /* packet thinks it is in the wrong direction, flip it */
+        StreamTcpPacketSwitchDir(ssn, p);
+
     } else if (p->tcph->th_flags & TH_SYN) {
         if (ssn == NULL) {
             ssn = StreamTcpNewSession(p, stt->ssn_pool_id);