]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Introduce g_detect_disabled global
authorVictor Julien <victor@inliniac.net>
Mon, 16 Dec 2013 16:25:11 +0000 (17:25 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 27 Jan 2014 12:22:47 +0000 (13:22 +0100)
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

index 3835586b4b355015fb65379aebf6fb3892582b02..b5002a105004c435266ded4edd6b5f065f5aee75 100644 (file)
@@ -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) {