summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-10-19 13:36:14 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-10-25 16:20:11 +0900
commite80a36317aacb142c282e0795b9f5b3a20aec1dc (patch)
tree869f48138ab16e9f72c4f40b654dd937fd6cdf5a
parent022406507ad21470b8ab3ffc3a1b752c5823c96e (diff)
dpset: Fix iteration error when disconnecting switches
When disconnecting switches, dpset will fail to unregister ports, because size of values in the port state dictionary might be changed when doing the iteration. This patch fixes to copy the values list and fixes this problem. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/dpset.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ryu/controller/dpset.py b/ryu/controller/dpset.py
index 5af6835a..8004b2a8 100644
--- a/ryu/controller/dpset.py
+++ b/ryu/controller/dpset.py
@@ -218,7 +218,7 @@ class DPSet(app_manager.RyuApp):
# Now datapath is already dead, so port status change event doesn't
# interfere us.
ev = EventDP(dp, False)
- for port in self.port_state.get(dp.id, {}).values():
+ for port in list(self.port_state.get(dp.id, {}).values()):
self._port_deleted(dp, port)
ev.ports.append(port)