From: Eric Leblond Date: Fri, 10 May 2013 08:27:17 +0000 (+0200) Subject: set rule_reload as part of SuriInstance X-Git-Tag: suricata-2.0beta2~442 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90aaf55201a78a8a061d9c94ed84edddd746273b;p=thirdparty%2Fsuricata.git set rule_reload as part of SuriInstance --- diff --git a/src/suricata.c b/src/suricata.c index 89fbdd1558..12fa376b69 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -177,8 +177,6 @@ SC_ATOMIC_DECLARE(unsigned int, engine_stage); /* Max packets processed simultaniously. */ #define DEFAULT_MAX_PENDING_PACKETS 1024 -int rule_reload = 0; - /** suricata engine control flags */ uint8_t suricata_ctl_flags = 0; @@ -899,6 +897,7 @@ struct SuriInstance { uint32_t groupid; #endif /* OS_WIN32 */ int delayed_detect; + int rule_reload; int daemon; char *log_dir; @@ -1665,7 +1664,7 @@ int main(int argc, char **argv) MpmCudaEnvironmentSetup(); #endif - rule_reload = IsRuleReloadSet(FALSE); + suri.rule_reload = IsRuleReloadSet(FALSE); AppLayerDetectProtoThreadInit(); AppLayerParsersInitPostProcess(); @@ -1791,7 +1790,7 @@ int main(int argc, char **argv) DetectEngineRegisterAppInspectionEngines(); - if (rule_reload) { + if (suri.rule_reload) { if (suri.sig_file == NULL) UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2Idle); else @@ -1954,7 +1953,7 @@ int main(int argc, char **argv) /* registering singal handlers we use. We register usr2 here, so that one * can't call it during the first sig load phase */ - if (suri.sig_file == NULL && rule_reload == 1) + if (suri.sig_file == NULL && suri.rule_reload == 1) UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2); SCThresholdConfInitContext(de_ctx,NULL); @@ -2083,7 +2082,7 @@ int main(int argc, char **argv) (((1000000 + end_time.tv_usec - start_time.tv_usec) / 1000) - 1000); SCLogInfo("time elapsed %.3fs", (float)milliseconds/(float)1000); - if (rule_reload == 1) { + if (suri.rule_reload == 1) { /* Disable detect threads first. This is required by live rule swap */ TmThreadDisableThreadsWithTMS(TM_FLAG_RECEIVE_TM | TM_FLAG_DECODE_TM | TM_FLAG_STREAM_TM | TM_FLAG_DETECT_TM);