]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: work around cocci limitation
authorVictor Julien <victor@inliniac.net>
Tue, 27 Oct 2015 20:49:00 +0000 (21:49 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 07:37:41 +0000 (09:37 +0200)
src/detect.c

index 2db63f08b4fde0bd82eb2a6f5b6345e45d8b01f1..add8f53b1ba0f8aa59c9e3971e64289f27d75f0d 100644 (file)
@@ -3388,8 +3388,13 @@ static DetectPort *RulesGroupByPorts(DetectEngineCtx *de_ctx, int ipproto, uint3
             goto next;
         if (!(s->proto.proto[ipproto / 8] & (1<<(ipproto % 8)) || (s->proto.flags & DETECT_PROTO_ANY)))
             goto next;
-        if (!(s->flags & direction))
-            goto next;
+        if (direction == SIG_FLAG_TOSERVER) {
+            if (!(s->flags & SIG_FLAG_TOSERVER))
+                goto next;
+        } else if (direction == SIG_FLAG_TOCLIENT) {
+            if (!(s->flags & SIG_FLAG_TOCLIENT))
+                goto next;
+        }
 
         DetectPort *p = NULL;
         if (direction == SIG_FLAG_TOSERVER)