detect: consolidate more setup into DetectEngineCtxInit

Loading of classifications, references and action order was done
unconditionally, so can be done in one place.
pull/1386/head
Victor Julien 12 years ago
parent 69f99245c5
commit 49bad2cfba

@ -551,13 +551,6 @@ static void *DetectEngineLiveRuleSwap(void *arg)
goto error; goto error;
} }
SCClassConfLoadClassficationConfigFile(de_ctx);
SCRConfLoadReferenceConfigFile(de_ctx);
if (ActionInitConfig() < 0) {
exit(EXIT_FAILURE);
}
if (SigLoadSignatures(de_ctx, NULL, FALSE) < 0) { if (SigLoadSignatures(de_ctx, NULL, FALSE) < 0) {
SCLogError(SC_ERR_NO_RULES_LOADED, "Loading signatures failed."); SCLogError(SC_ERR_NO_RULES_LOADED, "Loading signatures failed.");
if (de_ctx->failure_fatal) if (de_ctx->failure_fatal)
@ -879,6 +872,13 @@ DetectEngineCtx *DetectEngineCtxInit(void)
SCProfilingKeywordInitCounters(de_ctx); SCProfilingKeywordInitCounters(de_ctx);
#endif #endif
SCClassConfLoadClassficationConfigFile(de_ctx);
SCRConfLoadReferenceConfigFile(de_ctx);
if (ActionInitConfig() < 0) {
goto error;
}
return de_ctx; return de_ctx;
error: error:
return NULL; return NULL;

@ -2312,12 +2312,6 @@ int main(int argc, char **argv)
CudaVarsSetDeCtx(de_ctx); CudaVarsSetDeCtx(de_ctx);
#endif /* __SC_CUDA_SUPPORT__ */ #endif /* __SC_CUDA_SUPPORT__ */
SCClassConfLoadClassficationConfigFile(de_ctx);
SCRConfLoadReferenceConfigFile(de_ctx);
if (ActionInitConfig() < 0) {
exit(EXIT_FAILURE);
}
} else { } else {
/* disable raw reassembly */ /* disable raw reassembly */
(void)ConfSetFinal("stream.reassembly.raw", "false"); (void)ConfSetFinal("stream.reassembly.raw", "false");

Loading…
Cancel
Save