]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Reset app layer events when we start inspecting a new TX
authorVictor Julien <victor@inliniac.net>
Wed, 24 Apr 2013 12:59:30 +0000 (14:59 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 27 Jun 2013 16:17:15 +0000 (18:17 +0200)
src/decode-events.h
src/detect-dns-query.c

index 232a9c077080dda6d43efe6fd9664ed74ff1ddcd..6c7f4df7c4bf7ff349bc44c3efd11ab7fcf313f9 100644 (file)
@@ -366,6 +366,13 @@ static inline int AppLayerDecoderEventsIsEventSet(AppLayerDecoderEvents *devents
     return 0;
 }
 
+#define AppLayerDecoderEventsResetEvents(devents)           \
+    do {                                                    \
+        if ((devents) != NULL) {                            \
+            (devents)->cnt = 0;                             \
+        }                                                   \
+    } while (0)
+
 #define AppLayerDecoderEventsFreeEvents(devents)            \
     do {                                                    \
         if ((devents) != NULL) {                            \
index 5570239ff17e5f24327d51a1bc8ef467c7b48502..8f1c6597fe7f81da693883677db543c6ea05ddcf 100644 (file)
@@ -1028,16 +1028,12 @@ static int DetectDnsQueryTest07(void) {
         printf("(p3) sig 2 didn't alert, but it should have: ");
         goto end;
     }
-    /* VJ currently we when we reset de_state we reset AMATCH too,
-     * this resets app-layer-event matching as well. However, we
-     * are not clearing/reseting app events, so we match over and
-     * over again */
-#if 0
+    /** \todo should not alert, bug #839
     if (PacketAlertCheck(p3, 3)) {
-        printf("(p3) sig 3 did alerted, but it should not have: ");
+        printf("(p3) sig 3 did alert, but it should not have: ");
         goto end;
     }
-#endif
+    */
     result = 1;
 
 end: