diff options
author | Toshiki Tsuboi <t.tsubo2000@gmail.com> | 2015-10-16 23:28:30 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-28 17:43:58 +0900 |
commit | 5b81c634be0e28e8b9cce257e217829418241809 (patch) | |
tree | ccad7fb218eb4510686afb10c484724f3482d9aa | |
parent | 30e2eb67c40596fcb80eab8968c0858de45c177a (diff) |
bgp: fix of sending "Start-of-RIB" and "End-of-RIB" in Enhanced Route-Refresh
According to RFC 7313 [Enhanced Route Refresh Capability for BGP-4], Ryu bgps needs to send "Start-of-RIB" before it advertises the Adj-RIB-Out. And then, Ryu bgps needs to send "End-of-RIB" after it advertises the Adj-RIB-Out.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/packet/bgp.py | 1 | ||||
-rw-r--r-- | ryu/services/protocols/bgp/peer.py | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index 6563acef..f5575c46 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -2569,6 +2569,7 @@ class BGPRouteRefresh(BGPMessage): self.afi = afi self.safi = safi self.demarcation = demarcation + self.eor_sent = False @classmethod def parser(cls, buf): diff --git a/ryu/services/protocols/bgp/peer.py b/ryu/services/protocols/bgp/peer.py index c8eae4bc..fc8ee558 100644 --- a/ryu/services/protocols/bgp/peer.py +++ b/ryu/services/protocols/bgp/peer.py @@ -1752,7 +1752,7 @@ class Peer(Source, Sink, NeighborConfListener, Activity): # If enhanced route-refresh is valid/enabled, enqueue SOR. afi = af.afi safi = af.safi - sor = BGPRouteRefresh(afi, safi, reserved=1) + sor = BGPRouteRefresh(afi, safi, demarcation=1) self.enque_first_outgoing_msg(sor) # Ask core to re-send sent routes @@ -1767,9 +1767,9 @@ class Peer(Source, Sink, NeighborConfListener, Activity): sent. """ if self._protocol.is_enhanced_rr_cap_valid() and not sor.eor_sent: - afi = sor.route_family.afi - safi = sor.route_family.safi - eor = BGPRouteRefresh(afi, safi, reserved=2) + afi = sor.afi + safi = sor.safi + eor = BGPRouteRefresh(afi, safi, demarcation=2) self.enque_outgoing_msg(eor) sor.eor_sent = True |