diff --git a/src/detect-engine-alert.c b/src/detect-engine-alert.c index f51fa543d6..40490404d1 100644 --- a/src/detect-engine-alert.c +++ b/src/detect-engine-alert.c @@ -219,7 +219,7 @@ void PacketAlertFinalize(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx } else { /* Now, if we have an alert, we have to check if we want * to tag this session or src/dst host */ - sm = s->tmatch; + sm = s->sm_lists[DETECT_SM_LIST_TMATCH]; while (sm) { /* tags are set only for alerts */ sigmatch_table[sm->type].Match(NULL, det_ctx, p, s, sm); diff --git a/src/detect-parse.c b/src/detect-parse.c index 7a4c757a87..af7658949c 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -239,17 +239,17 @@ void SigMatchAppendDcePayload(Signature *s, SigMatch *new) { * \param new sigmatch to append */ void SigMatchAppendTag(Signature *s, SigMatch *new) { - if (s->tmatch == NULL) { - s->tmatch = new; - s->tmatch_tail = new; + if (s->sm_lists[DETECT_SM_LIST_TMATCH] == NULL) { + s->sm_lists[DETECT_SM_LIST_TMATCH] = new; + s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new; new->next = NULL; new->prev = NULL; } else { - SigMatch *cur = s->tmatch_tail; + SigMatch *cur = s->sm_lists_tail[DETECT_SM_LIST_TMATCH]; cur->next = new; new->prev = cur; new->next = NULL; - s->tmatch_tail = new; + s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new; } new->idx = s->sm_cnt; @@ -1072,7 +1072,7 @@ void SigFree(Signature *s) { sm = nsm; } - sm = s->tmatch; + sm = s->sm_lists[DETECT_SM_LIST_TMATCH]; while (sm != NULL) { nsm = sm->next; SigMatchFree(sm); diff --git a/src/detect.h b/src/detect.h index 677e234e75..144ecd266b 100644 --- a/src/detect.h +++ b/src/detect.h @@ -354,17 +354,6 @@ typedef struct Signature_ { /** netblocks and hosts specified at the sid, in CIDR format */ IPOnlyCIDRItem *CidrSrc, *CidrDst; - /* holds all sm lists */ - struct SigMatch_ *sm_lists[DETECT_SM_LIST_MAX]; - - /** ptr to the SigMatch lists */ - //struct SigMatch_ *pmatch; /* payload matches */ - //struct SigMatch_ *umatch; /* uricontent payload matches */ - //struct SigMatch_ *amatch; /* general app layer matches */ - //struct SigMatch_ *dmatch; /* dce app layer matches */ - //struct SigMatch_ *match; /* non-payload matches */ - struct SigMatch_ *tmatch; /* list of tags matches */ - struct SigMatch_ *dsize_sm; /* helper for init phase */ @@ -408,16 +397,11 @@ typedef struct Signature_ { uint16_t profiling_id; #endif + /* holds all sm lists */ + struct SigMatch_ *sm_lists[DETECT_SM_LIST_MAX]; /* holds all sm lists' tails */ struct SigMatch_ *sm_lists_tail[DETECT_SM_LIST_MAX]; - //struct SigMatch_ *match_tail; /* non-payload matches, tail of the list */ - //struct SigMatch_ *pmatch_tail; /* payload matches, tail of the list */ - //struct SigMatch_ *umatch_tail; /* uricontent payload matches, tail of the list */ - //struct SigMatch_ *amatch_tail; /* general app layer matches, tail of the list */ - //struct SigMatch_ *dmatch_tail; /* dce app layer matches, tail of the list */ - struct SigMatch_ *tmatch_tail; /* tag matches, tail of the list */ - /** address settings for this signature */ DetectAddressHead src, dst;