From a2d04a94b5e0b9a7e2745f08aa076ad5af964f47 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Thu, 21 Oct 2010 22:24:34 +0530 Subject: [PATCH] selecting auto for detect-engine.sgh_mpm_context now uses single if the mpm is ac, full otherwise --- src/detect-engine.c | 7 ++++++- src/detect.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/detect-engine.c b/src/detect-engine.c index a0ea8b8ba9..5352ae7a5f 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -182,7 +182,12 @@ static uint8_t DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) { } else if (strcmp(sgh_mpm_context, "full") == 0) { de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; } else if (strcmp(sgh_mpm_context, "auto") == 0) { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO; + /* for now, since we still haven't implemented any intelligence into + * understanding the patterns and distributing mpm_ctx across sgh */ + if (de_ctx->mpm_matcher == MPM_AC) + de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; + else + de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; } else { SCLogWarning(SC_ERR_INVALID_YAML_CONF_ENTRY, "You have supplied an " "invalid conf value for detect-engine.sgh-mpm-context-" diff --git a/src/detect.c b/src/detect.c index c08682e0d0..3721768518 100644 --- a/src/detect.c +++ b/src/detect.c @@ -3609,19 +3609,19 @@ int SigGroupBuild (DetectEngineCtx *de_ctx) { if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) { mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx); } - printf("packet- %d\n", mpm_ctx->pattern_cnt); + //printf("packet- %d\n", mpm_ctx->pattern_cnt); mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_uri); if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) { mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx); } - printf("uri- %d\n", mpm_ctx->pattern_cnt); + //printf("uri- %d\n", mpm_ctx->pattern_cnt); mpm_ctx = MpmFactoryGetMpmCtxForProfile(de_ctx->sgh_mpm_context_stream); if (mpm_table[de_ctx->mpm_matcher].Prepare != NULL) { mpm_table[de_ctx->mpm_matcher].Prepare(mpm_ctx); } - printf("stream- %d\n", mpm_ctx->pattern_cnt); + //printf("stream- %d\n", mpm_ctx->pattern_cnt); } // SigAddressPrepareStage5(de_ctx);