diff options
-rw-r--r-- | ryu/services/protocols/bgp/peer.py | 4 | ||||
-rw-r--r-- | ryu/services/protocols/bgp/processor.py | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/ryu/services/protocols/bgp/peer.py b/ryu/services/protocols/bgp/peer.py index c56b2941..d92e0d31 100644 --- a/ryu/services/protocols/bgp/peer.py +++ b/ryu/services/protocols/bgp/peer.py @@ -336,6 +336,10 @@ class Peer(Source, Sink, NeighborConfListener, Activity): return self._neigh_conf.ip_address @property + def protocol(self): + return self._protocol + + @property def host_bind_ip(self): return self._host_bind_ip diff --git a/ryu/services/protocols/bgp/processor.py b/ryu/services/protocols/bgp/processor.py index a5fcbcce..05b766a0 100644 --- a/ryu/services/protocols/bgp/processor.py +++ b/ryu/services/protocols/bgp/processor.py @@ -492,9 +492,9 @@ def _cmp_by_router_id(local_asn, path1, path2): # At least one path is not coming from NC, so we get local bgp id. if path_source1 is not None: - local_bgp_id = path_source1.protocol.sent_open.bgpid + local_bgp_id = path_source1.protocol.sent_open_msg.bgpid else: - local_bgp_id = path_source2.protocol.sent_open.bgpid + local_bgp_id = path_source2.protocol.sent_open_msg.bgpid # Get router ids. router_id1 = get_router_id(path_source1, local_bgp_id) @@ -506,9 +506,8 @@ def _cmp_by_router_id(local_asn, path1, path2): return None # Select the path with lowest router Id. - from ryu.services.protocols.bgp.ker.utils.bgp import from_inet_ptoi - if (from_inet_ptoi(router_id1) < - from_inet_ptoi(router_id2)): + from ryu.services.protocols.bgp.utils.bgp import from_inet_ptoi + if (from_inet_ptoi(router_id1) < from_inet_ptoi(router_id2)): return path1 else: return path2 |