BUG-5013 Check MatchUtils.createICMPv4Match input
authorJosh <jhershbe@redhat.com>
Tue, 19 Jan 2016 14:39:23 +0000 (16:39 +0200)
committerFlavio Fernandes <ffernand@redhat.com>
Tue, 19 Jan 2016 20:28:39 +0000 (15:28 -0500)
ALL_ICMP is in fact fed in at EgressAclService.java:388
which causes an exception to be thrown. This occurs during
various tempest tests.

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

index c40c82fa976c63d93a2af48112e7f9a9e1f4b2e9..c7e00473c13fa778485a50ce1b4dcf78bb99d7a8 100644 (file)
@@ -220,8 +220,12 @@ public class MatchUtils {
 
         // Build the ICMPv4 Match
         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();
-        icmpv4match.setIcmpv4Type(type);
-        icmpv4match.setIcmpv4Code(code);
+        if(type != ALL_ICMP) {
+            icmpv4match.setIcmpv4Type(type);
+        }
+        if(code != ALL_ICMP) {
+            icmpv4match.setIcmpv4Code(code);
+        }
         matchBuilder.setIcmpv4Match(icmpv4match.build());
 
         return matchBuilder;