]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: fix "no bfd profile" command
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 6 May 2021 11:54:37 +0000 (14:54 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 7 May 2021 09:03:57 +0000 (12:03 +0300)
Instead of setting the profile to an empty string we should destroy the
NB node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
isisd/isis_cli.c

index f316e0279ce83394e2e30d717f2dbba3d19f1c4e..ed10c39038bdc3fb665001d969436d334671926f 100644 (file)
@@ -378,8 +378,14 @@ DEFPY_YANG(isis_bfd_profile,
                return CMD_SUCCESS;
        }
 
-       nb_cli_enqueue_change(vty, "./frr-isisd:isis/bfd-monitoring/profile",
-                             NB_OP_MODIFY, no ? NULL : profile);
+       if (no)
+               nb_cli_enqueue_change(vty,
+                                     "./frr-isisd:isis/bfd-monitoring/profile",
+                                     NB_OP_DESTROY, NULL);
+       else
+               nb_cli_enqueue_change(vty,
+                                     "./frr-isisd:isis/bfd-monitoring/profile",
+                                     NB_OP_MODIFY, profile);
 
        return nb_cli_apply_changes(vty, NULL);
 }
@@ -387,18 +393,14 @@ DEFPY_YANG(isis_bfd_profile,
 void cli_show_ip_isis_bfd_monitoring(struct vty *vty, struct lyd_node *dnode,
                                     bool show_defaults)
 {
-       const char *profile;
-
        if (!yang_dnode_get_bool(dnode, "./enabled"))
                vty_out(vty, " no");
 
        vty_out(vty, " isis bfd\n");
 
-       if (yang_dnode_exists(dnode, "./profile")) {
-               profile = yang_dnode_get_string(dnode, "./profile");
-               if (profile[0] != '\0')
-                       vty_out(vty, " isis bfd profile %s\n", profile);
-       }
+       if (yang_dnode_exists(dnode, "./profile"))
+               vty_out(vty, " isis bfd profile %s\n",
+                       yang_dnode_get_string(dnode, "./profile"));
 }
 
 /*