From: Jufajardini Reichow Date: Mon, 25 Jul 2022 23:47:23 +0000 (-0300) Subject: detect/engine: init alert queue counters on reload X-Git-Tag: suricata-6.0.7~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7659%2Fhead;p=thirdparty%2Fsuricata.git 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) --- 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);