diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-08-08 21:38:50 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-08-23 21:08:20 +0200 |
commit | 07679ad98ab97a4b783f7ae54f88d4d70a5729de (patch) | |
tree | e2a670c3a68fb5b856cd52426c2f0b972a414bcb /ldpd | |
parent | pathd: rework config printing code (diff) | |
download | frr-07679ad98ab97a4b783f7ae54f88d4d70a5729de.tar.xz frr-07679ad98ab97a4b783f7ae54f88d4d70a5729de.zip |
*: 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 'ldpd')
-rw-r--r-- | ldpd/ldp_vty_conf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index b35d3dfa0..fbd718bb0 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -133,6 +133,8 @@ ldp_af_iface_config_write(struct vty *vty, int af) ia->hello_interval != 0) vty_out (vty, " discovery hello interval %u\n", ia->hello_interval); + + vty_out (vty, " exit\n"); } } @@ -314,6 +316,7 @@ ldp_config_write(struct vty *vty) ldp_af_config_write(vty, AF_INET, ldpd_conf, &ldpd_conf->ipv4); ldp_af_config_write(vty, AF_INET6, ldpd_conf, &ldpd_conf->ipv6); vty_out (vty, " !\n"); + vty_out (vty, "exit\n"); vty_out (vty, "!\n"); return (1); @@ -353,6 +356,8 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw) " ! Incomplete config, specify a neighbor lsr-id\n"); if (missing_pwid) vty_out (vty," ! Incomplete config, specify a pw-id\n"); + + vty_out (vty, " exit\n"); } static int @@ -383,6 +388,7 @@ ldp_l2vpn_config_write(struct vty *vty) ldp_l2vpn_pw_config_write(vty, pw); vty_out (vty, " !\n"); + vty_out (vty, "exit\n"); vty_out (vty, "!\n"); } |