Fix a bug in the Link Discovery module when a switch is disconnected.
Apparently, if the switch is disconnected from the controller and
then reconnected, the discovered link state in the LinkDiscoveryManager
is not cleaned-up properly.
As a result, the links are not published when the switch reconnects.
Depends on timing, the links might actually be removed from the
Topology Manager, but won't be added back.
Change-Id: I2c1e1da9190047a93bd917c79bac9babeeb4ef6f
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java b/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
index 8ffe4ee..42c2942 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
@@ -798,13 +798,7 @@
*/
@Override
public void switchDisconnected(long swId) {
- IOFSwitch sw = floodlightProvider.getSwitch(swId);
- if (sw == null) {
- log.warn("Removed switch not available {} ", swId);
- return;
- }
- // Update event history
-
+ // Cleanup link state
List<Link> eraseList = new ArrayList<Link>();
lock.writeLock().lock();
try {