From df421911cbbc241b6778500a1c4b2a9e40eb286a Mon Sep 17 00:00:00 2001 From: J vanBemmel Date: Sat, 4 Sep 2021 16:41:26 -0500 Subject: [PATCH 1/2] Fix bug where path.source is set to VRF_TABLE (in vrf.py) --- ryu/services/protocols/bgp/processor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ryu/services/protocols/bgp/processor.py b/ryu/services/protocols/bgp/processor.py index 789192ea..886e7097 100644 --- a/ryu/services/protocols/bgp/processor.py +++ b/ryu/services/protocols/bgp/processor.py @@ -36,6 +36,8 @@ from ryu.lib.packet.bgp import BGP_ATTR_ORIGIN_IGP from ryu.lib.packet.bgp import BGP_ATTR_ORIGIN_EGP from ryu.lib.packet.bgp import BGP_ATTR_ORIGIN_INCOMPLETE +from ryu.services.protocols.bgp.constants import VRF_TABLE + LOG = logging.getLogger('bgpspeaker.processor') @@ -428,7 +430,7 @@ def _cmp_by_asn(local_asn, path1, path2): """ def get_path_source_asn(path): asn = None - if path.source is None: + if path.source is None or path.source == VRF_TABLE: asn = local_asn else: asn = path.source.remote_as From ac849e3d4facb0833aa43cb73cecf7cd02f38c80 Mon Sep 17 00:00:00 2001 From: J vanBemmel Date: Sun, 5 Sep 2021 20:09:16 -0500 Subject: [PATCH 2/2] Fix major bug in child thread cleanup logic Without this fix, one cannot restart BGP Speaker instances --- ryu/services/protocols/bgp/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py index 8b69aa36..52a8398d 100644 --- a/ryu/services/protocols/bgp/base.py +++ b/ryu/services/protocols/bgp/base.py @@ -285,7 +285,7 @@ class Activity(object): """Stops all threads spawn by this activity. """ for thread_name, thread in list(self._child_thread_map.items()): - if name is not None and thread_name is name: + if name is None or thread_name == name: LOG.debug('%s: Stopping child thread %s', self.name, thread_name) thread.kill()