]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix setting of flag for rule reload
authorJason Ish <jason.ish@oisf.net>
Mon, 1 May 2023 16:50:40 +0000 (10:50 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 1 May 2023 19:56:03 +0000 (21:56 +0200)
As part of 6d8b50b748844e9de6010cde5a6b139148c0e937, the settings of
THV_CAPTURE_INJECT_PKT ended up in a location unreachable by capture
methods that did not have PktAcqBreakLoop.

Instead, always call TmThreadsCaptureBreakLoop which handles the logic
for how the read loop should be broken.

This fixes the case where read threads won't "break" for rule reloads
until packets are seen.

Ticket: #6021

src/detect-engine.c
src/tm-threads.h

index ce2d319d527f2ba8bc67de7a829988ee17c62cb6..23341087fdbe7dc8dc7e3498362fd7e5495b9c1c 100644 (file)
@@ -2278,7 +2278,7 @@ retry:
         if (SC_ATOMIC_GET(new_det_ctx[i]->so_far_used_by_detect) == 1) {
             SCLogDebug("new_det_ctx - %p used by detect engine", new_det_ctx[i]);
             threads_done++;
-        } else if (detect_tvs[i]->break_loop) {
+        } else {
             TmThreadsCaptureBreakLoop(detect_tvs[i]);
         }
     }
index e547064bc47ce1caa669f465d7670b927ec09278..76b1ce221e7cd88c04e7388ef371b7f97dd85792 100644 (file)
@@ -255,9 +255,6 @@ static inline void TmThreadsCaptureHandleTimeout(ThreadVars *tv, Packet *p)
 
 static inline void TmThreadsCaptureBreakLoop(ThreadVars *tv)
 {
-    if (unlikely(!tv->break_loop))
-        return;
-
     if ((tv->tmm_flags & TM_FLAG_RECEIVE_TM) == 0) {
         return;
     }