From: Victor Julien Date: Tue, 25 Nov 2014 10:50:03 +0000 (+0100) Subject: Assign thread_id to flow on first packet stream engine X-Git-Tag: suricata-2.1beta3~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48eccf7d916333400e2cbca778c39ba733abe118;p=thirdparty%2Fsuricata.git Assign thread_id to flow on first packet stream engine --- 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 */