]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flowworker: simplify pseudo packet use
authorVictor Julien <vjulien@oisf.net>
Mon, 15 May 2023 08:02:26 +0000 (10:02 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Oct 2023 15:50:44 +0000 (17:50 +0200)
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.

(cherry picked from commit 3247e39f0c6824b0fde20cfa8f4bbb596217eed2)

src/flow-worker.c

index 5d4ccd28eb0aa1486d1fb170d4976a5e847e176c..cac66ced4a69b15d294333380053abd855896253 100644 (file)
@@ -395,12 +395,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 preq queue so that they are
-             * 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);
         }
     }
 }