From 9ee265ab4535d6995d99cbee6bcfc344be411e77 Mon Sep 17 00:00:00 2001 From: Victor Orlikowski Date: Tue, 2 Aug 2016 11:01:52 +0900 Subject: [PATCH] Clean up stale Datapath objects in the ofctl_service application A quick patch to clean up stale Datapath objects in the ofctl_service application. Signed-off-by: Victor J. Orlikowski Signed-off-by: FUJITA Tomonori --- ryu/app/ofctl/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ryu/app/ofctl/service.py b/ryu/app/ofctl/service.py index 0ca00c71..19aebd4b 100644 --- a/ryu/app/ofctl/service.py +++ b/ryu/app/ofctl/service.py @@ -79,6 +79,8 @@ class OfctlService(app_manager.RyuApp): self.logger.debug('add dpid %s datapath %s new_info %s old_info %s', id, datapath, new_info, old_info) self._switches[id] = new_info + if old_info: + old_info.datapath.close() @set_ev_cls(ofp_event.EventOFPStateChange, DEAD_DISPATCHER) def _handle_dead(self, ev):