detect: remove unused content minlen tracking

pull/1980/head
Victor Julien 11 years ago
parent e43c4f3ea2
commit de273d88cc

@ -224,7 +224,7 @@ uint32_t SigGroupHeadHashFunc(HashListTable *ht, void *data, uint16_t datalen)
uint32_t hash = 0; uint32_t hash = 0;
uint32_t b = 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++) for (b = 0; b < sgh->init->sig_size; b++)
hash += sgh->init->sig_array[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 */ /* enable the sig in the bitarray */
(*sgh)->init->sig_array[s->num / 8] |= 1 << (s->num % 8); (*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; return 0;
error: error:
@ -453,17 +439,6 @@ int SigGroupHeadCopySigs(DetectEngineCtx *de_ctx, SigGroupHead *src, SigGroupHea
if (src->init->whitelist) if (src->init->whitelist)
(*dst)->init->whitelist = MAX((*dst)->init->whitelist, 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; return 0;
error: error:

@ -1111,8 +1111,8 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx,
} }
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_PACKET) { if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_PACKET) {
/* run the multi packet matcher against the payload of the packet */ /* run the multi packet matcher against the payload of the packet */
SCLogDebug("search: (%p, minlen %" PRIu32 ", sgh->sig_cnt %" PRIu32 ")", SCLogDebug("search: (%p, sgh->sig_cnt %" PRIu32 ")",
det_ctx->sgh, det_ctx->sgh->mpm_content_minlen, det_ctx->sgh->sig_cnt); det_ctx->sgh, det_ctx->sgh->sig_cnt);
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_PACKET); PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_PACKET);
PacketPatternSearch(det_ctx, p); PacketPatternSearch(det_ctx, p);

@ -965,9 +965,6 @@ typedef struct SigGroupHead_ {
/* number of sigs in this head */ /* number of sigs in this head */
SigIntId sig_cnt; SigIntId sig_cnt;
/* track min pattern length for content. Used in grouping */
uint16_t mpm_content_minlen;
/* non mpm list excluding SYN rules */ /* non mpm list excluding SYN rules */
uint32_t non_mpm_other_store_cnt; uint32_t non_mpm_other_store_cnt;
SignatureNonMpmStore *non_mpm_other_store_array; // size is non_mpm_store_cnt * sizeof(SignatureNonMpmStore) SignatureNonMpmStore *non_mpm_other_store_array; // size is non_mpm_store_cnt * sizeof(SignatureNonMpmStore)

Loading…
Cancel
Save