From: Victor Julien Date: Mon, 26 Oct 2020 13:27:13 +0000 (+0100) Subject: detect/mpm: rename variable to ease code review X-Git-Tag: suricata-6.0.1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee15bd80760f9d8298cdc676c3f9f0b80cd5ca46;p=thirdparty%2Fsuricata.git detect/mpm: rename variable to ease code review --- diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index ee3acb06f6..027063a6cb 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -226,7 +226,7 @@ void DetectMpmInitializeAppMpms(DetectEngineCtx *de_ctx) } /* default to whatever the global setting is */ - int shared = (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); + int shared = (de_ctx->sgh_mpm_ctx_cnf == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); /* see if we use a unique or shared mpm ctx for this type */ int confshared = 0; @@ -393,7 +393,7 @@ void DetectMpmInitializePktMpms(DetectEngineCtx *de_ctx) } /* default to whatever the global setting is */ - int shared = (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); + int shared = (de_ctx->sgh_mpm_ctx_cnf == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); /* see if we use a unique or shared mpm ctx for this type */ int confshared = 0; @@ -451,7 +451,7 @@ int DetectMpmPreparePktMpms(DetectEngineCtx *de_ctx) static int32_t SetupBuiltinMpm(DetectEngineCtx *de_ctx, const char *name) { /* default to whatever the global setting is */ - int shared = (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); + int shared = (de_ctx->sgh_mpm_ctx_cnf == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE); /* see if we use a unique or shared mpm ctx for this type */ int confshared = 0; diff --git a/src/detect-engine.c b/src/detect-engine.c index ead7de6011..bee88283be 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -2233,15 +2233,15 @@ static int DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) de_ctx->mpm_matcher == MPM_HS || #endif de_ctx->mpm_matcher == MPM_AC_BS) { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; + de_ctx->sgh_mpm_ctx_cnf = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; } else { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; + de_ctx->sgh_mpm_ctx_cnf = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; } } else { if (strcmp(sgh_mpm_context, "single") == 0) { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; + de_ctx->sgh_mpm_ctx_cnf = ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE; } else if (strcmp(sgh_mpm_context, "full") == 0) { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; + de_ctx->sgh_mpm_ctx_cnf = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; } else { SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "You have supplied an " "invalid conf value for detect-engine.sgh-mpm-context-" @@ -2251,7 +2251,7 @@ static int DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) } if (run_mode == RUNMODE_UNITTEST) { - de_ctx->sgh_mpm_context = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; + de_ctx->sgh_mpm_ctx_cnf = ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL; } /* parse profile custom-values */ diff --git a/src/detect.h b/src/detect.h index 00b6b80658..9e9547512c 100644 --- a/src/detect.h +++ b/src/detect.h @@ -826,7 +826,7 @@ typedef struct DetectEngineCtx_ { uint16_t max_uniq_toserver_groups; /* specify the configuration for mpm context factory */ - uint8_t sgh_mpm_context; + uint8_t sgh_mpm_ctx_cnf; /* max flowbit id that is used */ uint32_t max_fb_id;