Currently, when a connection is lost, BGP Speaker tries to
stop BGPProtocol instance, even if it already stops.
This commit fixes this by checking the status of BGPProtocol
instance before trying to stop it.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimo...@gmail.com>
---
 ryu/services/protocols/bgp/peer.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ryu/services/protocols/bgp/peer.py 
b/ryu/services/protocols/bgp/peer.py
index 70b486c..1e26bfd 100644
--- a/ryu/services/protocols/bgp/peer.py
+++ b/ryu/services/protocols/bgp/peer.py
@@ -2325,7 +2325,8 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
         )
         self.state.bgp_state = const.BGP_FSM_IDLE
         if self._protocol:
-            self._protocol.stop()
+            if self._protocol._started:
+                self._protocol.stop()
             self._protocol = None
             # Create new collection for initial RT NLRIs
             self._init_rtc_nlri_path = []
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to