Shortcut loops when no switches connected
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index bca9ef7..89415f0 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -127,6 +127,9 @@
}
Map<Long, IOFSwitch> mySwitches =
floodlightProvider.getSwitches();
+ if (mySwitches.isEmpty()) {
+ return;
+ }
LinkedList<IFlowEntry> addFlowEntries =
new LinkedList<IFlowEntry>();
LinkedList<IFlowEntry> deleteFlowEntries =
@@ -267,6 +270,9 @@
}
Map<Long, IOFSwitch> mySwitches =
floodlightProvider.getSwitches();
+ if (mySwitches.isEmpty()) {
+ return;
+ }
LinkedList<IFlowPath> deleteFlows = new LinkedList<IFlowPath>();
boolean processed_measurement_flow = false;