Skip to content

Commit

Permalink
detect/engine: init alert queue counters on reload
Browse files Browse the repository at this point in the history
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 OISF#5457
  • Loading branch information
jufajardini authored and benignbala committed Nov 12, 2022
1 parent d8dfa40 commit 1487d25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/detect-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1487d25

Please sign in to comment.