*
* \retval hash A 32 bit unsigned hash.
*/
-static inline MpmPattern *MpmInitHashLookup(MpmCtx *ctx, uint8_t *pat,
- uint16_t patlen, char flags,
- uint32_t pid)
+static inline MpmPattern *MpmInitHashLookup(MpmCtx *ctx,
+ uint8_t *pat, uint16_t patlen,
+ uint16_t offset, uint16_t depth,
+ uint8_t flags, uint32_t pid)
{
uint32_t hash = MpmInitHashRaw(pat, patlen);
if (t->id == pid)
return t;
} else {
- if (t->len == patlen &&
+ if (t->len == patlen && t->offset == offset && t->depth == depth &&
memcmp(pat, t->original_pat, patlen) == 0 &&
t->flags == flags)
{
pid = UINT_MAX;
/* check if we have already inserted this pattern */
- MpmPattern *p = MpmInitHashLookup(mpm_ctx, pat, patlen, flags, pid);
+ MpmPattern *p = MpmInitHashLookup(mpm_ctx, pat, patlen,
+ offset, depth, flags, pid);
if (p == NULL) {
SCLogDebug("Allocing new pattern");
p->len = patlen;
p->flags = flags;
+ p->offset = offset;
+ p->depth = depth;
if (flags & MPM_PATTERN_CTX_OWNS_ID)
p->id = mpm_ctx->max_pat_id++;
else