From 48eccf7d916333400e2cbca778c39ba733abe118 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 25 Nov 2014 11:50:03 +0100 Subject: [PATCH] Assign thread_id to flow on first packet stream engine --- src/stream-tcp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 5bb30f614a..9e3d8fb34c 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -4382,6 +4382,15 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt, SCLogDebug("p->pcap_cnt %"PRIu64, p->pcap_cnt); + /* assign the thread id to the flow */ + if (unlikely(p->flow->thread_id == 0)) { + p->flow->thread_id = (FlowThreadId)tv->id; +#ifdef DEBUG + } else if (unlikely((FlowThreadId)tv->id != p->flow->thread_id)) { + SCLogDebug("wrong thread: flow has %u, we are %d", p->flow->thread_id, tv->id); +#endif + } + TcpSession *ssn = (TcpSession *)p->flow->protoctx; /* track TCP flags */