diff options
author | Naveen Thanikachalam <nthanikachal@vmware.com> | 2020-06-16 14:20:41 +0200 |
---|---|---|
committer | Naveen Thanikachalam <nthanikachal@vmware.com> | 2020-07-14 10:39:39 +0200 |
commit | 77b34214ea44d4f9203f6728cbe67f73555c4735 (patch) | |
tree | a7f38fea4462e8d55617fd3b3bb847258d1b51ed /bgpd/bgp_fsm.c | |
parent | Merge pull request #6375 from adharkar/frr-master-l3vni_label (diff) | |
download | frr-77b34214ea44d4f9203f6728cbe67f73555c4735.tar.xz frr-77b34214ea44d4f9203f6728cbe67f73555c4735.zip |
bgpd: GR fixes
1) When a session comes up for a peer and if the peer has not adverised
the GR capabilities, BGP sends a request to Zebra to clear any
stale routes that might exist from that peer.
2) When OPEN message is received from the peer, clear the previously
advertised GR capability by the peer, if the lastest received
OPEN message does not contain the GR capability.
Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r-- | bgpd/bgp_fsm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index ce5747dc2..72964f1e7 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1863,6 +1863,30 @@ static int bgp_establish(struct peer *peer) } } + if (!CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) { + if ((bgp_peer_gr_mode_get(peer) == PEER_GR) + || ((bgp_peer_gr_mode_get(peer) == PEER_GLOBAL_INHERIT) + && (bgp_global_gr_mode_get(peer->bgp) == GLOBAL_GR))) { + FOREACH_AFI_SAFI (afi, safi) + /* Send route processing complete + message to RIB */ + bgp_zebra_update( + afi, safi, peer->bgp->vrf_id, + ZEBRA_CLIENT_ROUTE_UPDATE_COMPLETE); + } + } else { + /* Peer sends R-bit. In this case, we need to send + * ZEBRA_CLIENT_ROUTE_UPDATE_COMPLETE to Zebra. */ + if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_BIT_RCV)) { + FOREACH_AFI_SAFI (afi, safi) + /* Send route processing complete + message to RIB */ + bgp_zebra_update( + afi, safi, peer->bgp->vrf_id, + ZEBRA_CLIENT_ROUTE_UPDATE_COMPLETE); + } + } + peer->nsf_af_count = nsf_af_count; if (nsf_af_count) |