Skip to content

Commit

Permalink
Merge pull request #4376 from opensourcerouting/remove-deprecated-cmd
Browse files Browse the repository at this point in the history
bgpd: remove deprecated "bgp enforce-first-as" command
  • Loading branch information
donaldsharp authored May 21, 2019
2 parents a6002ca + 6982ab8 commit dddcb45
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
25 changes: 0 additions & 25 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,28 +2143,6 @@ DEFUN (no_bgp_fast_external_failover,
return CMD_SUCCESS;
}

/* "bgp enforce-first-as" configuration. */
#if CONFDATE > 20190517
CPP_NOTICE("bgpd: remove deprecated '[no] bgp enforce-first-as' commands")
#endif

DEFUN_HIDDEN (bgp_enforce_first_as,
bgp_enforce_first_as_cmd,
"[no] bgp enforce-first-as",
NO_STR
BGP_STR
"Enforce the first AS for EBGP routes\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);

if (strmatch(argv[0]->text, "no"))
bgp_flag_unset(bgp, BGP_FLAG_ENFORCE_FIRST_AS);
else
bgp_flag_set(bgp, BGP_FLAG_ENFORCE_FIRST_AS);

return CMD_SUCCESS;
}

/* "bgp bestpath compare-routerid" configuration. */
DEFUN (bgp_bestpath_compare_router_id,
bgp_bestpath_compare_router_id_cmd,
Expand Down Expand Up @@ -13036,9 +13014,6 @@ void bgp_vty_init(void)
install_element(BGP_NODE, &bgp_fast_external_failover_cmd);
install_element(BGP_NODE, &no_bgp_fast_external_failover_cmd);

/* "bgp enforce-first-as" commands */
install_element(BGP_NODE, &bgp_enforce_first_as_cmd);

/* "bgp bestpath compare-routerid" commands */
install_element(BGP_NODE, &bgp_bestpath_compare_router_id_cmd);
install_element(BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd);
Expand Down
15 changes: 0 additions & 15 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7557,12 +7557,6 @@ static void bgp_config_write_family(struct vty *vty, struct bgp *bgp, afi_t afi,
vty_endframe(vty, " exit-address-family\n");
}

/* clang-format off */
#if CONFDATE > 20190517
CPP_NOTICE("bgpd: remove 'bgp enforce-first-as' config migration from bgp_config_write")
#endif
/* clang-format on */

int bgp_config_write(struct vty *vty)
{
int write = 0;
Expand Down Expand Up @@ -7598,15 +7592,6 @@ int bgp_config_write(struct vty *vty)
if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
continue;

/* Migrate deprecated 'bgp enforce-first-as'
* config to 'neighbor * enforce-first-as' configs
*/
if (bgp_flag_check(bgp, BGP_FLAG_ENFORCE_FIRST_AS)) {
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer))
peer_flag_set(peer, PEER_FLAG_ENFORCE_FIRST_AS);
bgp_flag_unset(bgp, BGP_FLAG_ENFORCE_FIRST_AS);
}

/* Router bgp ASN */
vty_out(vty, "router bgp %u", bgp->as);

Expand Down
1 change: 0 additions & 1 deletion bgpd/bgpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ struct bgp {
#define BGP_FLAG_MED_CONFED (1 << 3)
#define BGP_FLAG_NO_DEFAULT_IPV4 (1 << 4)
#define BGP_FLAG_NO_CLIENT_TO_CLIENT (1 << 5)
#define BGP_FLAG_ENFORCE_FIRST_AS (1 << 6)
#define BGP_FLAG_COMPARE_ROUTER_ID (1 << 7)
#define BGP_FLAG_ASPATH_IGNORE (1 << 8)
#define BGP_FLAG_IMPORT_CHECK (1 << 9)
Expand Down

0 comments on commit dddcb45

Please sign in to comment.