]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix reachable assertion 7934/head
authorVictor Julien <vjulien@oisf.net>
Mon, 26 Sep 2022 15:14:39 +0000 (17:14 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 26 Sep 2022 15:14:43 +0000 (17:14 +0200)
Fix `Flow::thread_id` not always getting properly set up, leading to
a reachable assertion.

Bug #4582.

src/stream-tcp.c

index b9da110f1003ee6d06c2fcca9de55394d5b15df7..e487d6796ac9a58ad74e5f7f3d17b959f6f81013 100644 (file)
@@ -4941,8 +4941,6 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
 
     SCLogDebug("p->pcap_cnt %"PRIu64, p->pcap_cnt);
 
-    HandleThreadId(tv, p, stt);
-
     TcpSession *ssn = (TcpSession *)p->flow->protoctx;
 
     /* track TCP flags */
@@ -5365,6 +5363,8 @@ TmEcode StreamTcp (ThreadVars *tv, Packet *p, void *data, PacketQueueNoLock *pq)
         return TM_ECODE_OK;
     }
 
+    HandleThreadId(tv, p, stt);
+
     /* only TCP packets with a flow from here */
 
     if (!(p->flags & PKT_PSEUDO_STREAM_END)) {