summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormgrex97 <j6y4u4xup6@gmail.com>2017-08-23 15:13:44 +0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-29 22:51:15 +0900
commit0c0656f95a646756df5caae10734c2e561ff7b56 (patch)
tree7ba2ef15cec6abff4bece1ebd83d6fd0871d8dd2
parent80fedbfeafd955f844ea7a34e420d3718bf28151 (diff)
topology/switches: Fix delete port can't immediately remove link.
If remove port data from self.port_state first, self.get_port method can't get the port data, this problem will cause link can't immediately be removed. This patch remove port data after get_port and link delete. Signed-off-by: Yu Ren <j6y4u4xup6@gmail.com> Signed-off-by: mgrex97 <j6y4u4xup6@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/topology/switches.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 644a1fec..7264075a 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -717,7 +717,6 @@ class Switches(app_manager.RyuApp):
# LOG.debug('A port was deleted.' +
# '(datapath id = %s, port number = %s)',
# dp.id, ofpport.port_no)
- self.port_state[dp.id].remove(ofpport.port_no)
self.send_event_to_observers(
event.EventPortDelete(Port(dp.id, dp.ofproto, ofpport)))
@@ -730,6 +729,8 @@ class Switches(app_manager.RyuApp):
self._link_down(port)
self.lldp_event.set()
+ self.port_state[dp.id].remove(ofpport.port_no)
+
else:
assert reason == dp.ofproto.OFPPR_MODIFY
# LOG.debug('A port was modified.' +