BUG-5013 Fix check logic in MatchUtils.createICMPv4Match
authorJosh <jhershbe@redhat.com>
Tue, 19 Jan 2016 16:02:43 +0000 (18:02 +0200)
committerFlavio Fernandes <ffernand@redhat.com>
Tue, 19 Jan 2016 20:25:42 +0000 (15:25 -0500)
The original logic checked that *either* of the
input params was non-null instead of checking
each.

Change-Id: I941133c00b09335eb0cf4a48b9abf35d8b305438
Signed-off-by: Josh <jhershbe@redhat.com>
utils/mdsal-openflow/src/main/java/org/opendaylight/ovsdb/utils/mdsal/openflow/MatchUtils.java

index bbb93d8b5532b7363db72a76051b9572f5200604..7078486a92553a1d5a018a1fdc33c61cfc00c3c9 100644 (file)
@@ -236,8 +236,10 @@ public class MatchUtils {
 
         // Build the ICMPv4 Match
         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();
-        if (type != ALL_ICMP || code != ALL_ICMP) {
+        if (type != ALL_ICMP) {
             icmpv4match.setIcmpv4Type(type);
+        }
+        if (code != ALL_ICMP) {
             icmpv4match.setIcmpv4Code(code);
         }
         matchBuilder.setIcmpv4Match(icmpv4match.build());