]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix reachable assertion 7936/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 19:48:14 +0000 (21:48 +0200)
Fix `Flow::thread_id` not always getting properly set up, leading to
a reachable assertion.

Bug #4582.

(cherry picked from commit b06c0579f568226721f38f6a964bdffdfd1791fc)

src/stream-tcp.c

index 265da1ff90f47b952045cb235cd14d9961acb3a8..4f4024585ab7f0804d320113a3789c59ee7df099 100644 (file)
@@ -4850,8 +4850,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 */
@@ -5275,6 +5273,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)) {