]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix default value for affinity-mode 15175/head
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 19 Jan 2024 01:21:53 +0000 (03:21 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 19 Jan 2024 01:47:25 +0000 (03:47 +0200)
- 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>
lib/if.c
zebra/interface.c

index 1328e21874a163386cb5410f51d19a3527daef9f..1a8195de67de0386ebadf020b5bae11f951d56f6 100644 (file)
--- a/lib/if.c
+++ b/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;
 
        /* 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 */
        if (ifp->metric != 0) {
index cbc0eb69089b6ddf982a1f969e633ed8941b3cbe..5a246db4f22e3d186c70a10c89fea035546563d4 100644 (file)
@@ -4738,8 +4738,8 @@ DEFPY_YANG(link_params_affinity, link_params_affinity_cmd,
 DEFPY_YANG(link_params_affinity_mode, link_params_affinity_mode_cmd,
           "affinity-mode <standard|extended|both>$affmode",
           "Interface affinity mode\n"
-          "Standard Admin-Group only RFC3630,5305,5329 (default)\n"
-          "Extended Admin-Group only RFC7308\n"
+          "Standard Admin-Group only RFC3630,5305,5329\n"
+          "Extended Admin-Group only RFC7308 (default)\n"
           "Standard and extended Admin-Group format\n")
 {
        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_STR
           "Interface affinity mode\n"
-          "Standard Admin-Group only RFC3630,5305,5329 (default)\n"
-          "Extended Admin-Group only RFC7308\n"
+          "Standard Admin-Group only RFC3630,5305,5329\n"
+          "Extended Admin-Group only RFC7308 (default)\n"
           "Standard and extended Admin-Group format\n")
 {
        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);
 }
@@ -4788,6 +4788,8 @@ void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode,
                vty_out(vty, "  affinity-mode standard\n");
        else if (affinity_mode == AFFINITY_MODE_BOTH)
                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,