From: Renato Westphal Date: Sat, 24 Nov 2018 23:55:25 +0000 (-0200) Subject: ripd: fix display of the "distance" command X-Git-Tag: frr-7.1-dev~154^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=bb5b9c10c14ee9b9578f9e0b363784aa815c548d;p=matthieu%2Ffrr.git ripd: fix display of the "distance" command When displaying a configuration using the "with-defaults" option, do not display "distance 0" when the "distance" command is not configured. The range of accepted values is (1-255), so "distance 0" isn't a valid command. In this case, display "no distance". Signed-off-by: Renato Westphal --- diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c index 510aa66155..06348f666c 100644 --- a/ripd/rip_cli.c +++ b/ripd/rip_cli.c @@ -231,7 +231,11 @@ DEFPY (no_rip_distance, void cli_show_rip_distance(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { - vty_out(vty, " distance %s\n", yang_dnode_get_string(dnode, NULL)); + if (yang_dnode_is_default(dnode, NULL)) + vty_out(vty, " no distance\n"); + else + vty_out(vty, " distance %s\n", + yang_dnode_get_string(dnode, NULL)); } /*