Fixes Bug 6478 94/44394/1
authorAswin Suryanarayanan <asuryana@redhat.com>
Fri, 19 Aug 2016 09:28:50 +0000 (14:58 +0530)
committerSam Hague <shague@redhat.com>
Fri, 19 Aug 2016 12:09:51 +0000 (12:09 +0000)
Changed the code to match the destination port for TCP and UDP in both
egress and ingress.

Change-Id: I6da8373e6526ef621dfe90ecdfc51ed80db12c80
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronSecurityRuleListener.java

index e9ceaaedd3a4b94741b8d76e2a5db210dfba1d35..6d1aa6ac80c2164d8ec19c38ad11997ff9c112d6 100644 (file)
@@ -113,22 +113,13 @@ public class NeutronSecurityRuleListener
             isDirectionIngress = securityRule.getDirection().equals(DirectionIngress.class);
         }
         if (securityRule.getPortRangeMax() != null) {
-            if (isDirectionIngress) {
-                sourcePortRangeBuilder.setUpperPort(new PortNumber(securityRule.getPortRangeMax()));
-            } else {
-                destinationPortRangeBuilder.setUpperPort(new PortNumber(securityRule.getPortRangeMax()));
-            }
+            destinationPortRangeBuilder.setUpperPort(new PortNumber(securityRule.getPortRangeMax()));
+
         }
         if (securityRule.getPortRangeMin() != null) {
-            if (isDirectionIngress) {
-                sourcePortRangeBuilder.setLowerPort(new PortNumber(securityRule.getPortRangeMin()));
-                // set source port range if lower port is specified as it is mandatory parameter in acl model
-                aceIpBuilder.setSourcePortRange(sourcePortRangeBuilder.build());
-            } else {
-                destinationPortRangeBuilder.setLowerPort(new PortNumber(securityRule.getPortRangeMin()));
-                // set destination port range if lower port is specified as it is mandatory parameter in acl model
-                aceIpBuilder.setDestinationPortRange(destinationPortRangeBuilder.build());
-            }
+            destinationPortRangeBuilder.setLowerPort(new PortNumber(securityRule.getPortRangeMin()));
+            // set destination port range if lower port is specified as it is mandatory parameter in acl model
+            aceIpBuilder.setDestinationPortRange(destinationPortRangeBuilder.build());
         }
         aceIpBuilder = handleRemoteIpPrefix(securityRule, aceIpBuilder, isDirectionIngress);
         if (securityRule.getRemoteGroupId() != null) {