Skip to content

Commit d684e28

Browse files
authored
Merge pull request FRRouting#20347 from FRRouting/mergify/bp/stable/10.5/pr-20341
bgpd: Send route-refresh and/or trigger soft reconfig on enforce-first-as (backport FRRouting#20341)
2 parents 7f6fa2a + 9d85bd0 commit d684e28

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

bgpd/bgp_vty.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,11 +2912,25 @@ DEFPY(bgp_enforce_first_as,
29122912
"Enforce the first AS for EBGP routes\n")
29132913
{
29142914
VTY_DECLVAR_CONTEXT(bgp, bgp);
2915+
struct listnode *node;
2916+
struct peer *peer;
2917+
afi_t afi;
2918+
safi_t safi;
29152919

2916-
if (no)
2920+
if (no) {
2921+
if (!CHECK_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS))
2922+
return CMD_SUCCESS;
29172923
UNSET_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS);
2918-
else
2924+
} else {
2925+
if (CHECK_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS))
2926+
return CMD_SUCCESS;
29192927
SET_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS);
2928+
}
2929+
2930+
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
2931+
FOREACH_AFI_SAFI (afi, safi)
2932+
peer_on_policy_change(peer, afi, safi, 0);
2933+
}
29202934

29212935
return CMD_SUCCESS;
29222936
}

0 commit comments

Comments
 (0)