]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/engine: init alert queue counters on reload 7659/head
authorJufajardini Reichow <jufajardini@oisf.net>
Mon, 25 Jul 2022 23:47:23 +0000 (20:47 -0300)
committerVictor Julien <vjulien@oisf.net>
Thu, 28 Jul 2022 14:44:51 +0000 (16:44 +0200)
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

index c64fd80b32d9f11066fd4ccede577278b52cadfb..4bb2cde8479ea140b0acda2c646c4673f97c07ed 100644 (file)
@@ -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);