From 1597fb660db4b9aeeb24c2701052137d08bf6f5b Mon Sep 17 00:00:00 2001 From: Flavio Fernandes Date: Thu, 14 May 2015 17:19:06 -0400 Subject: [PATCH] Make NeutronL3Adapter node filter out non br-int bridges Patch 2: use MdsalUtils.getBridge() Patch 3: remove unused import Change-Id: I4daf0d086e156d7540b7dd3b829a9fbf8783cd1f Signed-off-by: Flavio Fernandes --- .../netvirt/impl/NeutronL3Adapter.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java index 626aefb1d..208fe6959 100644 --- a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java +++ b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java @@ -252,7 +252,11 @@ public class NeutronL3Adapter { logger.trace("updateL3ForNeutronPort has no nodes to work with"); } for (Node node : nodes) { - final Long dpid = getDpid(node); + final Long dpid = getDpidForIntegrationBridge(node); + if (dpid == null) { + continue; + } + final boolean tenantNetworkPresentInNode = tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId); for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { @@ -375,7 +379,11 @@ public class NeutronL3Adapter { logger.trace("programFlowsForNeutronRouterInterface has no nodes to work with"); } for (Node node : nodes) { - final Long dpid = getDpid(node); + final Long dpid = getDpidForIntegrationBridge(node); + if (dpid == null) { + continue; + } + final Action actionForNode = tenantNetworkManager.isTenantNetworkPresentInNode(node, destinationSegmentationId) ? action : Action.DELETE; @@ -806,7 +814,11 @@ public class NeutronL3Adapter { logger.trace("programFlowsForFloatingIP has no nodes to work with"); } for (Node node : nodes) { - final Long dpid = getDpid(node); + final Long dpid = getDpidForIntegrationBridge(node); + if (dpid == null) { + continue; + } + final Action actionForNode = tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId) ? action : Action.DELETE; @@ -925,10 +937,11 @@ public class NeutronL3Adapter { return result; } - private Long getDpid(Node node) { - /* TODO SB_MIGRATION */ - // may need to go from OvsdbNode to BridgeNode - // get integration bridge on this node and then get dpid - return MdsalUtils.getDataPathId(node); + private Long getDpidForIntegrationBridge(Node node) { + // Check if node is integration bridge; and only then return its dpid + if (MdsalUtils.getBridge(node, configurationService.getIntegrationBridgeName()) != null) { + return MdsalUtils.getDataPathId(node); + } + return null; } } -- 2.36.6