]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: remove unused content minlen tracking
authorVictor Julien <victor@inliniac.net>
Wed, 21 Oct 2015 06:32:00 +0000 (08:32 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 07:37:41 +0000 (09:37 +0200)
src/detect-engine-siggroup.c
src/detect.c
src/detect.h

index 243cf6aeb7efb176a5fcbb4f4373a3abba9738b1..18c36c6959db34b264aa08d268c7d647cac717c6 100644 (file)
@@ -224,7 +224,7 @@ uint32_t SigGroupHeadHashFunc(HashListTable *ht, void *data, uint16_t datalen)
     uint32_t hash = 0;
     uint32_t b = 0;
 
-    SCLogDebug("hashing sgh %p (mpm_content_minlen %u)", sgh, sgh->mpm_content_minlen);
+    SCLogDebug("hashing sgh %p", sgh);
 
     for (b = 0; b < sgh->init->sig_size; b++)
         hash += sgh->init->sig_array[b];
@@ -382,20 +382,6 @@ int SigGroupHeadAppendSig(const DetectEngineCtx *de_ctx, SigGroupHead **sgh,
     /* enable the sig in the bitarray */
     (*sgh)->init->sig_array[s->num / 8] |= 1 << (s->num % 8);
 
-    /* update minlen for mpm */
-    if (s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL) {
-        /* check with the precalculated values from the sig */
-        uint16_t mpm_content_minlen = SignatureGetMpmPatternLen(s, DETECT_SM_LIST_PMATCH);
-        if (mpm_content_minlen > 0) {
-            if ((*sgh)->mpm_content_minlen == 0)
-                (*sgh)->mpm_content_minlen = mpm_content_minlen;
-
-            if ((*sgh)->mpm_content_minlen > mpm_content_minlen)
-                (*sgh)->mpm_content_minlen = mpm_content_minlen;
-
-            SCLogDebug("(%p)->mpm_content_minlen %u", *sgh, (*sgh)->mpm_content_minlen);
-        }
-    }
     return 0;
 
 error:
@@ -453,17 +439,6 @@ int SigGroupHeadCopySigs(DetectEngineCtx *de_ctx, SigGroupHead *src, SigGroupHea
     if (src->init->whitelist)
         (*dst)->init->whitelist = MAX((*dst)->init->whitelist, src->init->whitelist);
 
-    if (src->mpm_content_minlen != 0) {
-        if ((*dst)->mpm_content_minlen == 0)
-            (*dst)->mpm_content_minlen = src->mpm_content_minlen;
-
-        if ((*dst)->mpm_content_minlen > src->mpm_content_minlen)
-            (*dst)->mpm_content_minlen = src->mpm_content_minlen;
-
-        SCLogDebug("src (%p)->mpm_content_minlen %u", src, src->mpm_content_minlen);
-        SCLogDebug("dst (%p)->mpm_content_minlen %u", (*dst), (*dst)->mpm_content_minlen);
-        BUG_ON((*dst)->mpm_content_minlen == 0);
-    }
     return 0;
 
 error:
index 2c8ff73351cf91bbb49a502fe6f47470becd7985..223644708e2be8ce974a8ac9d6c7bbd7422fbdb9 100644 (file)
@@ -1111,8 +1111,8 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx,
         }
         if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_PACKET) {
             /* run the multi packet matcher against the payload of the packet */
-            SCLogDebug("search: (%p, minlen %" PRIu32 ", sgh->sig_cnt %" PRIu32 ")",
-                    det_ctx->sgh, det_ctx->sgh->mpm_content_minlen, det_ctx->sgh->sig_cnt);
+            SCLogDebug("search: (%p, sgh->sig_cnt %" PRIu32 ")",
+                    det_ctx->sgh, det_ctx->sgh->sig_cnt);
 
             PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_PACKET);
             PacketPatternSearch(det_ctx, p);
index da3d1b88d73a6547be4052e82528350f9b7716c8..721cd8a29ac9587e59737828a77e66a0c3c6786a 100644 (file)
@@ -965,9 +965,6 @@ typedef struct SigGroupHead_ {
     /* number of sigs in this head */
     SigIntId sig_cnt;
 
-    /* track min pattern length for content. Used in grouping */
-    uint16_t mpm_content_minlen;
-
     /* non mpm list excluding SYN rules */
     uint32_t non_mpm_other_store_cnt;
     SignatureNonMpmStore *non_mpm_other_store_array; // size is non_mpm_store_cnt * sizeof(SignatureNonMpmStore)