]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
counters: only print alerts if stats are enabled
authorShivani Bhardwaj <shivanib134@gmail.com>
Mon, 21 Jun 2021 18:35:06 +0000 (00:05 +0530)
committerJeff Lucovsky <jeff@lucovsky.org>
Fri, 17 Sep 2021 17:34:32 +0000 (13:34 -0400)
(cherry picked from commit a17da8374a905ad31a4fa66f85ee1cc73b857389)

src/counters.c

index 7952a12dfdc223a047c30459bdbb986dafae1fee..fbf8a009d308a535f70a1b24826b253f5a1113f5 100644 (file)
@@ -837,6 +837,9 @@ TmEcode StatsOutputCounterSocket(json_t *cmd,
 
 static void StatsLogSummary(void)
 {
+  if (!stats_enabled) {
+    return;
+  }
     uint64_t alerts = 0;
     SCMutexLock(&stats_table_mutex);
     if (stats_table.start_time != 0) {