]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
detect/mpm: rename variable to ease code review
authorVictor Julien <victor@inliniac.net>
Mon, 26 Oct 2020 13:27:13 +0000 (14:27 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Nov 2020 15:30:40 +0000 (16:30 +0100)
src/detect-engine-mpm.c
src/detect-engine.c
src/detect.h

index ee3acb06f60a66c96ae11633f331a42a33049fdf..027063a6cb4822cd8fa7d050f0af8a70b8c7c837 100644 (file)
@@ -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;
index ead7de6011d1384a6f1c53cd0010eca6c929d21e..bee88283beeb60a639469300d53b429ab2f7b413 100644 (file)
@@ -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 */
index 00b6b806585acbe0a8fa0dfd91752476b924d0b1..9e9547512c84ba8436a33a4f5f42703c5db8253c 100644 (file)
@@ -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;