mpm/hs: track maxdepth

pull/3747/head
Victor Julien 7 years ago
parent 928fe1b859
commit 7cea1e4181

@ -313,6 +313,17 @@ static int SCHSAddPattern(MpmCtx *mpm_ctx, uint8_t *pat, uint16_t patlen,
mpm_ctx->pattern_cnt++;
if (!(mpm_ctx->flags & MPMCTX_FLAGS_NODEPTH)) {
if (depth) {
mpm_ctx->maxdepth = MAX(mpm_ctx->maxdepth, depth);
SCLogDebug("%p: depth %u max %u", mpm_ctx, depth, mpm_ctx->maxdepth);
} else {
mpm_ctx->flags |= MPMCTX_FLAGS_NODEPTH;
mpm_ctx->maxdepth = 0;
SCLogDebug("%p: alas, no depth for us", mpm_ctx);
}
}
if (mpm_ctx->maxlen < patlen)
mpm_ctx->maxlen = patlen;

Loading…
Cancel
Save