Bug 5435 - Arp flows are not getting installed properly in compute nodes
authoroshvartz <oshvartz@redhat.com>
Tue, 15 Mar 2016 09:02:30 +0000 (11:02 +0200)
committeroshvartz <oshvartz@redhat.com>
Tue, 15 Mar 2016 09:02:30 +0000 (11:02 +0200)
Do not clean router interface ARP flows even if the
network segmentation does not exists in the given node.

Change-Id: I6de68c6b2e2d34d7f982eca74dfc73d42d26a5df
Signed-off-by: oshvartz <oshvartz@redhat.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/DistributedArpService.java

index 8a7fd5cae86f6247edfc2816ad508334ccd5152b..3633cda2cb2ad2a6c0f4bd07e99de36453f3e7d4 100644 (file)
@@ -43,6 +43,7 @@ public class DistributedArpService implements ConfigInterface {
 
     private static final Logger LOG = LoggerFactory.getLogger(DistributedArpService.class);
     private static final String DHCP_DEVICE_OWNER = "network:dhcp";
+    private static final String ROUTER_INTERFACE_DEVICE_OWNER = "network:router_interface";
     // The implementation for each of these services is resolved by the OSGi Service Manager
     private volatile ConfigurationService configurationService;
     private volatile TenantNetworkManager tenantNetworkManager;
@@ -185,8 +186,11 @@ public class DistributedArpService implements ConfigInterface {
         }
 
         for (Node node : nodes) {
-            // Arp rule is only needed when segmentation exists in the given node (bug 4752).
-            boolean arpNeeded = tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId);
+            // Arp rule is only needed when segmentation exists in the given node (bug 4752)
+            // or in case the port is a router interface
+            boolean isRouterInterface = owner != null && owner.equals(ROUTER_INTERFACE_DEVICE_OWNER);
+            boolean arpNeeded = isRouterInterface ||
+                    tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId);
             final Action actionForNode = arpNeeded ? actionToPerform : Action.DELETE;
 
             final Long dpid = getDatapathIdIntegrationBridge(node);