Don't send port events to the TopologyManager for switches we're not in control of.
Change-Id: I092115bf0fdf0c9f6a22fa6a8308c74ec13dafc1
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
index 6c90003..904ca3f 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
@@ -152,15 +152,19 @@
@Override
public void switchPortAdded(Long switchId, OFPhysicalPort port) {
- PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
- topologyDiscoveryInterface.putPortDiscoveryEvent(portEvent);
- linkDiscovery.removeFromSuppressLLDPs(switchId, port.getPortNumber());
+ if (registryService.hasControl(switchId)) {
+ PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
+ topologyDiscoveryInterface.putPortDiscoveryEvent(portEvent);
+ linkDiscovery.removeFromSuppressLLDPs(switchId, port.getPortNumber());
+ }
}
@Override
public void switchPortRemoved(Long switchId, OFPhysicalPort port) {
- PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
- topologyDiscoveryInterface.removePortDiscoveryEvent(portEvent);
+ if (registryService.hasControl(switchId)) {
+ PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
+ topologyDiscoveryInterface.removePortDiscoveryEvent(portEvent);
+ }
}
@Override