From: Renato Westphal Date: Wed, 26 Jul 2017 22:37:49 +0000 (-0300) Subject: vtysh: fix markfile output for ldpd X-Git-Tag: frr-4.0-dev~482^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a701f7eaa27a6a816170997439a96f43082c9833;p=mirror%2Ffrr.git vtysh: fix markfile output for ldpd Put the "end" marker in the right places. This should fix the frr-reload.py script because it depends on the output of vtysh -m. Signed-off-by: Renato Westphal --- diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 395982189c..adf47ed57c 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -498,6 +498,29 @@ int vtysh_mark_file(const char *filename) strcpy(vty_buf_copy, vty->buf); vty_buf_trimmed = trim(vty_buf_copy); + switch (vty->node) { + case LDP_IPV4_IFACE_NODE: + if (strncmp(vty_buf_copy, " ", 3)) { + fprintf(stdout, " end\n"); + vty->node = LDP_IPV4_NODE; + } + break; + case LDP_IPV6_IFACE_NODE: + if (strncmp(vty_buf_copy, " ", 3)) { + fprintf(stdout, " end\n"); + vty->node = LDP_IPV6_NODE; + } + break; + case LDP_PSEUDOWIRE_NODE: + if (strncmp(vty_buf_copy, " ", 2)) { + fprintf(stdout, " end\n"); + vty->node = LDP_L2VPN_NODE; + } + break; + default: + break; + } + if (vty_buf_trimmed[0] == '!' || vty_buf_trimmed[0] == '#') { fprintf(stdout, "%s", vty->buf); continue;