]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: fix problems with the "ip rip authentication" command
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 5 Apr 2019 01:28:00 +0000 (22:28 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 2 Jul 2019 01:56:52 +0000 (22:56 -0300)
libyang-0.16-r3 doesn't allow the creation of data nodes if their
corresponding "when" statement (if any) resolves to false. This
change broke the "ip rip authentication" command.

This commit adapts this command so that it's not affected by the
new libyang stricter validation checks.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripd/rip_cli.c

index 346e93b8effecf8b0b7b56ebc1d42fd91c2a29b4..627d3d1993655dadeef931a47eaafca6f83a0f3c 100644 (file)
@@ -829,8 +829,10 @@ DEFPY (ip_rip_authentication_mode,
 
        nb_cli_enqueue_change(vty, "./authentication-scheme/mode", NB_OP_MODIFY,
                              strmatch(mode, "md5") ? "md5" : "plain-text");
-       nb_cli_enqueue_change(vty, "./authentication-scheme/md5-auth-length",
-                             NB_OP_MODIFY, value);
+       if (strmatch(mode, "md5"))
+               nb_cli_enqueue_change(vty,
+                                     "./authentication-scheme/md5-auth-length",
+                                     NB_OP_MODIFY, value);
 
        return nb_cli_apply_changes(vty, "./frr-ripd:rip");
 }
@@ -852,7 +854,7 @@ DEFPY (no_ip_rip_authentication_mode,
        nb_cli_enqueue_change(vty, "./authentication-scheme/mode", NB_OP_MODIFY,
                              NULL);
        nb_cli_enqueue_change(vty, "./authentication-scheme/md5-auth-length",
-                             NB_OP_MODIFY, NULL);
+                             NB_OP_DESTROY, NULL);
 
        return nb_cli_apply_changes(vty, "./frr-ripd:rip");
 }