]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: fix two 'no X' commands
authorEmanuele Di Pascale <emanuele@voltanet.io>
Tue, 7 Apr 2020 16:41:15 +0000 (18:41 +0200)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Tue, 7 Apr 2020 19:57:08 +0000 (21:57 +0200)
for some reason, when issuing a 'no metric-style' command we were
setting the metric-style to narrow, even though the default is
actually wide. Use NULL to avoid similar problems in the future.

Likewise, the 'no is-type' command was still trying to implement
the old logic of applying a different default for the first area.
In practice this had no effect because the value would now be the
same in both cases, but it's better to remove useless code anyway.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
isisd/isis_cli.c

index 2483d26833bd79d24933cdc82beada880a7eaccf..b5e52d82a3ae05b2964b3e6fd8c095e7ec6d4ff6 100644 (file)
@@ -402,21 +402,7 @@ DEFPY(no_is_type, no_is_type_cmd,
       "Act as both a station router and an area router\n"
       "Act as an area router only\n")
 {
-       const char *value = NULL;
-       struct isis_area *area;
-
-       area = nb_running_get_entry(NULL, VTY_CURR_XPATH, false);
-
-       /*
-        * Put the is-type back to defaults:
-        * - level-1-2 on first area
-        * - level-1 for the rest
-        */
-       if (area && listgetdata(listhead(isis->area_list)) == area)
-               value = "level-1-2";
-       else
-               value = NULL;
-       nb_cli_enqueue_change(vty, "./is-type", NB_OP_MODIFY, value);
+       nb_cli_enqueue_change(vty, "./is-type", NB_OP_MODIFY, NULL);
 
        return nb_cli_apply_changes(vty, NULL);
 }
@@ -527,7 +513,7 @@ DEFPY(no_metric_style, no_metric_style_cmd,
       "Send and accept both styles of TLVs during transition\n"
       "Use new style of TLVs to carry wider metric\n")
 {
-       nb_cli_enqueue_change(vty, "./metric-style", NB_OP_MODIFY, "narrow");
+       nb_cli_enqueue_change(vty, "./metric-style", NB_OP_MODIFY, NULL);
 
        return nb_cli_apply_changes(vty, NULL);
 }