]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/engine: init alert queue counters on reload 7641/head
authorJufajardini Reichow <jufajardini@oisf.net>
Mon, 25 Jul 2022 23:47:23 +0000 (20:47 -0300)
committerJufajardini Reichow <jufajardini@oisf.net>
Mon, 25 Jul 2022 23:51:58 +0000 (20:51 -0300)
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

src/detect-engine.c

index 2189721f79cc71794eb797f43fadf97e231c8d71..bbdaa53a09589dadca85bc942b37adc288d3844a 100644 (file)
@@ -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);