aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/providers/openflow/device
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-23 08:31:31 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-23 08:31:31 -0700
commite52e67767076b29cb01939aa7bdd8fee9d205cc1 (patch)
treeb8c2d28231bccc2a280fea429a9af7297c62f58f /framework/src/onos/providers/openflow/device
parenta912c5ce9968da5936a695064f22083898e7b93d (diff)
Update ONOS src to commit id 69b36d5d11e81e28e56b46ba44e4b8cd701c5867
Change-Id: I9c13045711dbf9c0181106b66a6bf22c72bcf330 Signed-off-by: Ashlee Young <ashlee@onosfw.com>
Diffstat (limited to 'framework/src/onos/providers/openflow/device')
-rw-r--r--framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
index 329df20b..a7e334f4 100644
--- a/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
+++ b/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -319,6 +319,9 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
}
DeviceId did = deviceId(uri(dpid));
OpenFlowSwitch sw = controller.getSwitch(dpid);
+ if (sw == null) {
+ return;
+ }
ChassisId cId = new ChassisId(dpid.value());
@@ -339,9 +342,14 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
providerService.updatePorts(did, buildPortDescriptions(sw));
PortStatsCollector psc =
- new PortStatsCollector(controller.getSwitch(dpid), portStatsPollFrequency);
+ new PortStatsCollector(sw, portStatsPollFrequency);
psc.start();
collectors.put(dpid, psc);
+
+ //figure out race condition for collectors.remove() and collectors.put()
+ if (controller.getSwitch(dpid) == null) {
+ switchRemoved(dpid);
+ }
}
@Override
@@ -364,6 +372,9 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
}
DeviceId did = deviceId(uri(dpid));
OpenFlowSwitch sw = controller.getSwitch(dpid);
+ if (sw == null) {
+ return;
+ }
providerService.updatePorts(did, buildPortDescriptions(sw));
}