]> 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)
committerVictor Julien <victor@inliniac.net>
Mon, 6 Sep 2021 09:49:00 +0000 (11:49 +0200)
(cherry picked from commit a17da8374a905ad31a4fa66f85ee1cc73b857389)

src/counters.c

index b1c64f2cd9f18d4f806f0cad6019318b6e5a10e4..2d9fabeca937ee0bb808f45a5e10fa75dc33e2bc 100644 (file)
@@ -838,6 +838,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) {