From 258778cde491af02541ce1fcdc76ae60af6565d4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 16 Dec 2013 17:25:11 +0100 Subject: [PATCH] Introduce g_detect_disabled global This global will be set to TRUE if detect is disabled. The reason for adding a global is that there currently is no clean way to pass configuration options to management threads. --- src/suricata.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/suricata.c b/src/suricata.c index 3835586b4b..b5002a1050 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -196,6 +196,9 @@ uint8_t host_mode = SURI_HOST_IS_SNIFFER_ONLY; /** Maximum packets to simultaneously process. */ intmax_t max_pending_packets; +/** global indicating if detection is enabled */ +int g_detect_disabled = 0; + /** set caps or not */ int sc_set_caps; @@ -1208,7 +1211,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) suri->pid_filename = optarg; } else if(strcmp((long_opts[option_index]).name, "disable-detection") == 0) { - suri->disabled_detect = 1; + g_detect_disabled = suri->disabled_detect = 1; SCLogInfo("detection engine disabled"); } else if(strcmp((long_opts[option_index]).name, "fatal-unittests") == 0) {