File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments