]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flowworker: flush local work queue on capture timeout
authorVictor Julien <vjulien@oisf.net>
Wed, 10 May 2023 05:02:27 +0000 (07:02 +0200)
committerVictor Julien <vjulien@oisf.net>
Wed, 10 May 2023 08:59:17 +0000 (10:59 +0200)
Capture timeout means no packets have been received for some
time, so this is a good time to flush out all work.

src/flow-worker.c

index 3b122c7246bb3159db47307979b29e8e550b85ce..aad47df9821ae2a2661c74ad17d97dc08be97600 100644 (file)
@@ -485,7 +485,7 @@ static inline void FlowWorkerProcessInjectedFlows(
 static inline void FlowWorkerProcessLocalFlows(ThreadVars *tv, FlowWorkerThreadData *fw, Packet *p)
 {
     uint32_t max_work = 2;
-    if (p->pkt_src == PKT_SRC_SHUTDOWN_FLUSH)
+    if (p->pkt_src == PKT_SRC_SHUTDOWN_FLUSH || p->pkt_src == PKT_SRC_CAPTURE_TIMEOUT)
         max_work = 0;
 
     FLOWWORKER_PROFILING_START(p, PROFILE_FLOWWORKER_FLOW_EVICTED);