From 41967bf1191f3d0af902e7a74a217a4b6473e401 Mon Sep 17 00:00:00 2001 From: Jufajardini Reichow Date: Mon, 25 Jul 2022 20:47:23 -0300 Subject: [PATCH] detect/engine: init alert queue counters on reload alert_queue_overflow and alerts_suppressed were not being reinitialized when there was a reload of Suricata rules, leading to non-valid stats counters if that happened. Bug #5457 (cherry picked from commit 93c2c9743d4ebe35017317a2668c6f8a54498d34) --- src/detect-engine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/detect-engine.c b/src/detect-engine.c index c64fd80b32..4bb2cde847 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -2934,6 +2934,8 @@ static DetectEngineThreadCtx *DetectEngineThreadCtxInitForReload( /** alert counter setup */ det_ctx->counter_alerts = StatsRegisterCounter("detect.alert", tv); + det_ctx->counter_alerts_overflow = StatsRegisterCounter("detect.alert_queue_overflow", tv); + det_ctx->counter_alerts_suppressed = StatsRegisterCounter("detect.alerts_suppressed", tv); #ifdef PROFILING uint16_t counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv); uint16_t counter_nonmpm_list = StatsRegisterAvgCounter("detect.nonmpm_list", tv); -- 2.47.2