diff --git a/src/detect-siggroup.c b/src/detect-siggroup.c index 3415f68bed..149d0ef6e8 100644 --- a/src/detect-siggroup.c +++ b/src/detect-siggroup.c @@ -81,14 +81,11 @@ int SigGroupAppend(DetectAddressGroup *ag, Signature *s) { if (ag->sh->head == NULL) { /* put it as first in the list */ ag->sh->head = sg; + ag->sh->tail = sg; } else { /* append to the list */ - tmp_sg = ag->sh->head; - while (tmp_sg->next != NULL) { - tmp_sg = tmp_sg->next; - } - - tmp_sg->next = sg; + tmp_sg = ag->sh->tail; + ag->sh->tail = tmp_sg->next = sg; } ag->sh->sig_cnt++; return 0; diff --git a/src/detect.h b/src/detect.h index 9872b6ebe0..8cd8b70bbb 100644 --- a/src/detect.h +++ b/src/detect.h @@ -109,6 +109,7 @@ typedef struct _SigGroupHead { /* list of signature containers */ SigGroupContainer *head; + SigGroupContainer *tail; u_int32_t sig_cnt; u_int32_t refcnt; @@ -138,9 +139,9 @@ enum { DETECT_METADATA, DETECT_REFERENCE, DETECT_MSG, - DETECT_CONTENT, - DETECT_URICONTENT, - DETECT_PCRE, + DETECT_CONTENT, /* 8 */ + DETECT_URICONTENT, /* 9 */ + DETECT_PCRE, /* 10 */ DETECT_DEPTH, DETECT_DISTANCE, DETECT_WITHIN,