diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-09-04 17:39:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 17:39:26 +0200 |
commit | 08194f561e2c8ffd092dd64795db699f83a9075c (patch) | |
tree | d46aca2e388129e8dc860e63ab67f06d0e2a61f6 | |
parent | Merge pull request #6826 from pjdruddy/bgp-auth-vrf-frr (diff) | |
parent | bgpd: GR fixes (diff) | |
download | frr-08194f561e2c8ffd092dd64795db699f83a9075c.tar.xz frr-08194f561e2c8ffd092dd64795db699f83a9075c.zip |
Merge pull request #6589 from NaveenThanikachalam/gr_fixes
bgpd: GR fixes
-rw-r--r-- | bgpd/bgp_fsm.c | 24 | ||||
-rw-r--r-- | bgpd/bgp_open.c | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 28e93c409..58a2d42ba 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1872,6 +1872,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) diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 732c8e675..6cfcb9cc3 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -1102,6 +1102,9 @@ int bgp_open_option_parse(struct peer *peer, uint8_t length, int *mp_capability) zlog_debug("%s rcv OPEN w/ OPTION parameter len: %u", peer->host, length); + /* Unset any previously received GR capability. */ + UNSET_FLAG(peer->cap, PEER_CAP_RESTART_RCV); + while (stream_get_getp(s) < end) { uint8_t opt_type; uint8_t opt_length; |