Merge pull request #8678 from achernavin22/bgp_confed_peer_sort

bgpd: recalc peer's sort after changing confed peers
This commit is contained in:
Donald Sharp 2021-05-19 14:33:22 -04:00 committed by GitHub
commit b5ca4a47d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -671,6 +671,7 @@ int bgp_confederation_peers_add(struct bgp *bgp, as_t as)
if (bgp_config_check(bgp, BGP_CONFIG_CONFEDERATION)) {
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
if (peer->as == as) {
(void)peer_sort(peer);
peer->local_as = bgp->as;
if (BGP_IS_VALID_STATE_FOR_NOTIF(
peer->status)) {
@ -722,6 +723,7 @@ int bgp_confederation_peers_remove(struct bgp *bgp, as_t as)
if (bgp_config_check(bgp, BGP_CONFIG_CONFEDERATION)) {
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
if (peer->as == as) {
(void)peer_sort(peer);
peer->local_as = bgp->confed_id;
if (BGP_IS_VALID_STATE_FOR_NOTIF(
peer->status)) {