From a701f7eaa27a6a816170997439a96f43082c9833 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 26 Jul 2017 19:37:49 -0300 Subject: [PATCH] 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 --- vtysh/vtysh.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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; -- 2.39.5