]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-engine/tags: avoid confusion over data type
authorVictor Julien <victor@inliniac.net>
Sun, 12 Apr 2020 09:25:45 +0000 (11:25 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Apr 2020 12:37:34 +0000 (14:37 +0200)
src/detect-engine-tag.c

index f2ede4cee0f51e4534b42fec41b0770b472cac73..5ae72cc0fbd26353e4a325de5d920b5a38f00393 100644 (file)
@@ -184,7 +184,7 @@ int TagHashAddTag(DetectTagDataEntry *tde, Packet *p)
     SCEnter();
 
     uint8_t updated = 0;
-    uint16_t num_tags = 0;
+    uint16_t ntags = 0;
     Host *host = NULL;
 
     /* Lookup host in the hash. If it doesn't exist yet it's
@@ -217,7 +217,7 @@ int TagHashAddTag(DetectTagDataEntry *tde, Packet *p)
         DetectTagDataEntry *iter = NULL;
 
         for (iter = tag; iter != NULL; iter = iter->next) {
-            num_tags++;
+            ntags++;
             if (iter->sid == tde->sid && iter->gid == tde->gid) {
                 iter->cnt_match++;
                 /* If so, update data, unless the maximum MATCH limit is
@@ -234,7 +234,7 @@ int TagHashAddTag(DetectTagDataEntry *tde, Packet *p)
         }
 
         /* If there was no entry of this rule, append the new tde */
-        if (updated == 0 && num_tags < DETECT_TAG_MAX_TAGS) {
+        if (updated == 0 && ntags < DETECT_TAG_MAX_TAGS) {
             /* get a new tde as the one we have is on the stack */
             DetectTagDataEntry *new_tde = DetectTagDataCopy(tde);
             if (new_tde != NULL) {
@@ -243,8 +243,8 @@ int TagHashAddTag(DetectTagDataEntry *tde, Packet *p)
                 new_tde->next = tag;
                 HostSetStorageById(host, host_tag_id, new_tde);
             }
-        } else if (num_tags == DETECT_TAG_MAX_TAGS) {
-            SCLogDebug("Max tags for sessions reached (%"PRIu16")", num_tags);
+        } else if (ntags == DETECT_TAG_MAX_TAGS) {
+            SCLogDebug("Max tags for sessions reached (%"PRIu16")", ntags);
         }
     }