]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/analyzer: Suppress direction warnings
authorJeff Lucovsky <jeff@lucovsky.org>
Fri, 6 Dec 2019 00:15:13 +0000 (19:15 -0500)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Dec 2019 10:13:20 +0000 (11:13 +0100)
This commit ensures direction warnings for ICMP v4 and v6
are suppressed and corrects check so that both protocols
are checked (instead of the same protocol being checked twice).

src/detect-engine-analyzer.c

index d8bcbd162caf040295d5c13196027dbf830b6754..1f7acc92b798b0c9d0c9184ab7b208e600f62d66 100644 (file)
@@ -1199,7 +1199,7 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx,
     }
 
     /* No warning about direction for ICMP protos */
-    if (!(DetectProtoContainsProto(&s->proto, IPPROTO_ICMP) && DetectProtoContainsProto(&s->proto, IPPROTO_ICMP))) {
+    if (!(DetectProtoContainsProto(&s->proto, IPPROTO_ICMPV6) && DetectProtoContainsProto(&s->proto, IPPROTO_ICMP))) {
         if ((s->flags & (SIG_FLAG_TOSERVER|SIG_FLAG_TOCLIENT)) == (SIG_FLAG_TOSERVER|SIG_FLAG_TOCLIENT)) {
             warn_both_direction += 1;
             rule_warning += 1;