From: Victor Julien Date: Mon, 15 May 2023 08:02:26 +0000 (+0200) Subject: flowworker: simplify pseudo packet use X-Git-Tag: suricata-7.0.0-rc2~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8888%2Fhead;p=thirdparty%2Fsuricata.git flowworker: simplify pseudo packet use Pseudo packets originating in the flow worker do not need to leave the flow worker. Putting those in the ThreadVars::decode_pq will make them be evaluated by the next steps in the pipeline, but those will all ignore pseudo packets. Instead, this patch returns them to the packet pool, while still honoring the IPS verdict logic. --- diff --git a/src/flow-worker.c b/src/flow-worker.c index 9ecfe65f29..ffdd2defdc 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -407,12 +407,13 @@ static inline void FlowWorkerStreamTCPUpdate(ThreadVars *tv, FlowWorkerThreadDat /* no need to keep a flow ref beyond this point */ FlowDeReference(&x->flow); + /* no further work to do for this pseudo packet, so we can return + * it to the pool immediately. */ if (timeout) { PacketPoolReturnPacket(x); } else { - /* put these packets in the decode queue so that they are processed - * by the other thread modules before packet 'p'. */ - PacketEnqueueNoLock(&tv->decode_pq, x); + /* to support IPS verdict logic, in the non-timeout case we need to do a bit more */ + TmqhOutputPacketpool(tv, x); } } }