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-7.0.0-beta1~382 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7641%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 --- diff --git a/src/detect-engine.c b/src/detect-engine.c index 2189721f79..bbdaa53a09 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -3237,6 +3237,8 @@ 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);