summaryrefslogtreecommitdiff
path: root/bfdd/bfdd_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-08-08 22:38:50 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-08-23 22:08:20 +0300
commit07679ad98ab97a4b783f7ae54f88d4d70a5729de (patch)
treee2a670c3a68fb5b856cd52426c2f0b972a414bcb /bfdd/bfdd_cli.c
parentac9103aadc4a3da65b30952d69fdc535ae87604f (diff)
*: explicitly print "exit" at the end of every node config
There is a possibility that the same line can be matched as a command in some node and its parent node. In this case, when reading the config, this line is always executed as a command of the child node. For example, with the following config: ``` router ospf network 193.168.0.0/16 area 0 ! mpls ldp discovery hello interval 111 ! ``` Line `mpls ldp` is processed as command `mpls ldp-sync` inside the `router ospf` node. This leads to a complete loss of `mpls ldp` node configuration. To eliminate this issue and all possible similar issues, let's print an explicit "exit" at the end of every node config. This commit also changes indentation for a couple of existing exit commands so that all existing commands are on the same level as their corresponding node-entering commands. Fixes #9206. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd/bfdd_cli.c')
-rw-r--r--bfdd/bfdd_cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index 26ff4a758a..384bb26fd7 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -101,6 +101,7 @@ void bfd_cli_show_header(struct vty *vty,
void bfd_cli_show_header_end(struct vty *vty,
struct lyd_node *dnode __attribute__((__unused__)))
{
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
@@ -275,6 +276,7 @@ void bfd_cli_show_multi_hop_peer(struct vty *vty,
void bfd_cli_show_peer_end(struct vty *vty,
struct lyd_node *dnode __attribute__((__unused__)))
{
+ vty_out(vty, " exit\n");
vty_out(vty, " !\n");
}