From c89507836b29a9559e7b3b282591f5ebc6c3e8f2 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Tue, 16 Nov 2010 19:19:45 +0530 Subject: [PATCH] if sgh-mpm-context is not available in conf, alias the auto case inside the engine --- src/detect-engine.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/detect-engine.c b/src/detect-engine.c index e33d8f2d8b..71cb9814d7 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -238,8 +238,15 @@ static uint8_t DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) { } } else { SCLogInfo("You have not supplied a value for " - "detect-engine.sgh-mpm-context. Using default value of \"full\""); - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; + "detect-engine.sgh-mpm-context. Using default value of \"auto\""); + if (de_ctx->mpm_matcher == MPM_AC || de_ctx->mpm_matcher == MPM_AC_GFBS) + de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; + else + de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; + + /* someday when our engine turns intelligent we will actualy support this + * option internally */ + //de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO; }