From fe45258fbd0b3d720b7f3ad4f0e9ae380ec00460 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 1 May 2023 10:50:40 -0600 Subject: [PATCH] detect: fix setting of flag for rule reload 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 (cherry picked from commit 1c6644ef4eda43e7b14447b18409e8b35f59344d) --- src/detect-engine.c | 2 +- src/tm-threads.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/detect-engine.c b/src/detect-engine.c index 8dd210d963..9555b085f7 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1929,7 +1929,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]); } } diff --git a/src/tm-threads.h b/src/tm-threads.h index a2b998f15d..207a0fb7ff 100644 --- a/src/tm-threads.h +++ b/src/tm-threads.h @@ -256,9 +256,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; } -- 2.47.2