mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 10:49:24 +00:00
bgpd: Fix bgp bestpath med ...
commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
33e1e4eacb
commit
6cbd1915d2
@ -1989,31 +1989,7 @@ DEFUN (no_bgp_log_neighbor_changes,
|
|||||||
/* "bgp bestpath med" configuration. */
|
/* "bgp bestpath med" configuration. */
|
||||||
DEFUN (bgp_bestpath_med,
|
DEFUN (bgp_bestpath_med,
|
||||||
bgp_bestpath_med_cmd,
|
bgp_bestpath_med_cmd,
|
||||||
"bgp bestpath med <confed|missing-as-worst>",
|
"bgp bestpath med [<confed [missing-as-worst]|missing-as-worst [confed]>]",
|
||||||
"BGP specific commands\n"
|
|
||||||
"Change the default bestpath selection\n"
|
|
||||||
"MED attribute\n"
|
|
||||||
"Compare MED among confederation paths\n"
|
|
||||||
"Treat missing MED as the least preferred one\n")
|
|
||||||
{
|
|
||||||
int idx_med_knob = 3;
|
|
||||||
struct bgp *bgp;
|
|
||||||
|
|
||||||
bgp = vty->index;
|
|
||||||
|
|
||||||
if (strncmp (argv[idx_med_knob]->arg, "confed", 1) == 0)
|
|
||||||
bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);
|
|
||||||
else
|
|
||||||
bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
|
||||||
|
|
||||||
bgp_recalculate_all_bestpaths (bgp);
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (bgp_bestpath_med2,
|
|
||||||
bgp_bestpath_med2_cmd,
|
|
||||||
"bgp bestpath med <confed missing-as-worst|missing-as-worst confed>",
|
|
||||||
"BGP specific commands\n"
|
"BGP specific commands\n"
|
||||||
"Change the default bestpath selection\n"
|
"Change the default bestpath selection\n"
|
||||||
"MED attribute\n"
|
"MED attribute\n"
|
||||||
@ -2022,20 +1998,23 @@ DEFUN (bgp_bestpath_med2,
|
|||||||
"Treat missing MED as the least preferred one\n"
|
"Treat missing MED as the least preferred one\n"
|
||||||
"Compare MED among confederation paths\n")
|
"Compare MED among confederation paths\n")
|
||||||
{
|
{
|
||||||
struct bgp *bgp;
|
struct bgp *bgp = vty->index;
|
||||||
|
|
||||||
bgp = vty->index;
|
int idx = 0;
|
||||||
|
if (argv_find (argv, argc, "confed", &idx))
|
||||||
bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);
|
bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);
|
||||||
|
idx = 0;
|
||||||
|
if (argv_find (argv, argc, "missing-as-worst", &idx))
|
||||||
bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
||||||
|
|
||||||
bgp_recalculate_all_bestpaths (bgp);
|
bgp_recalculate_all_bestpaths (bgp);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFUN (no_bgp_bestpath_med,
|
DEFUN (no_bgp_bestpath_med,
|
||||||
no_bgp_bestpath_med_cmd,
|
no_bgp_bestpath_med_cmd,
|
||||||
"no bgp bestpath med <confed|missing-as-worst>",
|
"no bgp bestpath med [<confed [missing-as-worst]|missing-as-worst [confed]>]",
|
||||||
NO_STR
|
NO_STR
|
||||||
"BGP specific commands\n"
|
"BGP specific commands\n"
|
||||||
"Change the default bestpath selection\n"
|
"Change the default bestpath selection\n"
|
||||||
@ -2043,14 +2022,13 @@ DEFUN (no_bgp_bestpath_med,
|
|||||||
"Compare MED among confederation paths\n"
|
"Compare MED among confederation paths\n"
|
||||||
"Treat missing MED as the least preferred one\n")
|
"Treat missing MED as the least preferred one\n")
|
||||||
{
|
{
|
||||||
int idx_med_knob = 4;
|
struct bgp *bgp = vty->index;
|
||||||
struct bgp *bgp;
|
|
||||||
|
|
||||||
bgp = vty->index;
|
int idx = 0;
|
||||||
|
if (argv_find (argv, argc, "confed", &idx))
|
||||||
if (strncmp (argv[idx_med_knob]->arg, "confed", 1) == 0)
|
|
||||||
bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);
|
bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);
|
||||||
else
|
idx = 0;
|
||||||
|
if (argv_find (argv, argc, "missing-as-worst", &idx))
|
||||||
bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
||||||
|
|
||||||
bgp_recalculate_all_bestpaths (bgp);
|
bgp_recalculate_all_bestpaths (bgp);
|
||||||
@ -2058,26 +2036,6 @@ DEFUN (no_bgp_bestpath_med,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (no_bgp_bestpath_med2,
|
|
||||||
no_bgp_bestpath_med2_cmd,
|
|
||||||
"no bgp bestpath med [confed] missing-as-worst",
|
|
||||||
NO_STR
|
|
||||||
"BGP specific commands\n"
|
|
||||||
"Change the default bestpath selection\n"
|
|
||||||
"MED attribute\n"
|
|
||||||
"Compare MED among confederation paths\n"
|
|
||||||
"Treat missing MED as the least preferred one\n")
|
|
||||||
{
|
|
||||||
struct bgp *bgp;
|
|
||||||
|
|
||||||
bgp = vty->index;
|
|
||||||
bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);
|
|
||||||
bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
|
|
||||||
bgp_recalculate_all_bestpaths (bgp);
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* "no bgp default ipv4-unicast". */
|
/* "no bgp default ipv4-unicast". */
|
||||||
DEFUN (no_bgp_default_ipv4_unicast,
|
DEFUN (no_bgp_default_ipv4_unicast,
|
||||||
no_bgp_default_ipv4_unicast_cmd,
|
no_bgp_default_ipv4_unicast_cmd,
|
||||||
@ -9995,9 +9953,7 @@ bgp_vty_init (void)
|
|||||||
|
|
||||||
/* "bgp bestpath med" commands */
|
/* "bgp bestpath med" commands */
|
||||||
install_element (BGP_NODE, &bgp_bestpath_med_cmd);
|
install_element (BGP_NODE, &bgp_bestpath_med_cmd);
|
||||||
install_element (BGP_NODE, &bgp_bestpath_med2_cmd);
|
|
||||||
install_element (BGP_NODE, &no_bgp_bestpath_med_cmd);
|
install_element (BGP_NODE, &no_bgp_bestpath_med_cmd);
|
||||||
install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd);
|
|
||||||
|
|
||||||
/* "no bgp default ipv4-unicast" commands. */
|
/* "no bgp default ipv4-unicast" commands. */
|
||||||
install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd);
|
install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user