mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 14:17:20 +00:00
zebra: fix default value for affinity-mode
- initialize the necessary bit when creating if_link_params - fix CLI description to mark extended as the default mode - correctly set mode to extended when using the "no" form of the command - handle the "show_defaults" parameter correctly in cli_show callback Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
733462a991
commit
01be34fa34
2
lib/if.c
2
lib/if.c
@ -1135,7 +1135,7 @@ struct if_link_params *if_link_params_enable(struct interface *ifp)
|
|||||||
iflp->unrsv_bw[i] = iflp->default_bw;
|
iflp->unrsv_bw[i] = iflp->default_bw;
|
||||||
|
|
||||||
/* Update Link parameters status */
|
/* Update Link parameters status */
|
||||||
iflp->lp_status = LP_MAX_BW | LP_MAX_RSV_BW | LP_UNRSV_BW;
|
iflp->lp_status = LP_MAX_BW | LP_MAX_RSV_BW | LP_UNRSV_BW | LP_EXTEND_ADM_GRP;
|
||||||
|
|
||||||
/* Set TE metric equal to standard metric only if it is set */
|
/* Set TE metric equal to standard metric only if it is set */
|
||||||
if (ifp->metric != 0) {
|
if (ifp->metric != 0) {
|
||||||
|
@ -4738,8 +4738,8 @@ DEFPY_YANG(link_params_affinity, link_params_affinity_cmd,
|
|||||||
DEFPY_YANG(link_params_affinity_mode, link_params_affinity_mode_cmd,
|
DEFPY_YANG(link_params_affinity_mode, link_params_affinity_mode_cmd,
|
||||||
"affinity-mode <standard|extended|both>$affmode",
|
"affinity-mode <standard|extended|both>$affmode",
|
||||||
"Interface affinity mode\n"
|
"Interface affinity mode\n"
|
||||||
"Standard Admin-Group only RFC3630,5305,5329 (default)\n"
|
"Standard Admin-Group only RFC3630,5305,5329\n"
|
||||||
"Extended Admin-Group only RFC7308\n"
|
"Extended Admin-Group only RFC7308 (default)\n"
|
||||||
"Standard and extended Admin-Group format\n")
|
"Standard and extended Admin-Group format\n")
|
||||||
{
|
{
|
||||||
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
||||||
@ -4753,13 +4753,13 @@ DEFPY_YANG(no_link_params_affinity_mode, no_link_params_affinity_mode_cmd,
|
|||||||
"no affinity-mode [<standard|extended|both>]",
|
"no affinity-mode [<standard|extended|both>]",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Interface affinity mode\n"
|
"Interface affinity mode\n"
|
||||||
"Standard Admin-Group only RFC3630,5305,5329 (default)\n"
|
"Standard Admin-Group only RFC3630,5305,5329\n"
|
||||||
"Extended Admin-Group only RFC7308\n"
|
"Extended Admin-Group only RFC7308 (default)\n"
|
||||||
"Standard and extended Admin-Group format\n")
|
"Standard and extended Admin-Group format\n")
|
||||||
{
|
{
|
||||||
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
||||||
|
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, "standard");
|
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, "extended");
|
||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
}
|
}
|
||||||
@ -4788,6 +4788,8 @@ void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode,
|
|||||||
vty_out(vty, " affinity-mode standard\n");
|
vty_out(vty, " affinity-mode standard\n");
|
||||||
else if (affinity_mode == AFFINITY_MODE_BOTH)
|
else if (affinity_mode == AFFINITY_MODE_BOTH)
|
||||||
vty_out(vty, " affinity-mode both\n");
|
vty_out(vty, " affinity-mode both\n");
|
||||||
|
else if (affinity_mode == AFFINITY_MODE_EXTENDED && show_defaults)
|
||||||
|
vty_out(vty, " affinity-mode extended\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
|
void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
|
||||||
|
Loading…
Reference in New Issue
Block a user