From 94b7ff4649f80a2a388f28d2728fe85b890546cf Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 4 Apr 2019 22:28:00 -0300 Subject: ripd: fix problems with the "ip rip authentication" command 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 --- ripd/rip_cli.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ripd') diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c index 346e93b8e..627d3d199 100644 --- a/ripd/rip_cli.c +++ b/ripd/rip_cli.c @@ -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"); } -- cgit v1.2.3