diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-07-18 17:29:54 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-07-18 17:29:54 +0200 |
commit | 13f48fd6759cfdec35f17e37037e587cab5ec8e1 (patch) | |
tree | 0a53e0b96c9b09100819a9c122d2ee9c5c294600 /vtysh | |
parent | Merge pull request #4685 from chiragshah6/ospf_vrf_dev (diff) | |
download | frr-13f48fd6759cfdec35f17e37037e587cab5ec8e1.tar.xz frr-13f48fd6759cfdec35f17e37037e587cab5ec8e1.zip |
vtysh: mark exit-vrf with end when using vtysh -m
VRF context blocks have a context-specific exit command in order to
explicitly force an exit to the top level config node. This command
exists because 'ip route' commands are accepted in both VRF_NODE and
CONFIG_NODE, so static routes intended to be accepted in CONFIG_NODE
that immediately follow a VRF_NODE block will be shoved into the
VRF_NODE block unless the VRF context is explicitly exited.
However, because this is a command that exits to CONFIG_NODE, vtysh -m
should be printing an `end` at the end of the context, since
frr-reload.py relies on this context ender to know when it's back in
CONFIG_NODE. But since this is the only explicit context exit command
that also exits to CONFIG_NODE we don't really have a good way of doing
this already. Hence this god-awful patch.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vtysh')
-rw-r--r-- | vtysh/vtysh.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 053848bfc..3bc5955e8 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -851,11 +851,15 @@ int vtysh_mark_file(const char *filename) return CMD_ERR_INCOMPLETE; case CMD_SUCCESS: vty_out(vty, "%s", vty->buf); + if (strmatch(vty_buf_trimmed, "exit-vrf")) + vty_out(vty, "end\n"); break; case CMD_SUCCESS_DAEMON: { int cmd_stat; vty_out(vty, "%s", vty->buf); + if (strmatch(vty_buf_trimmed, "exit-vrf")) + vty_out(vty, "end\n"); cmd_stat = vtysh_client_execute(&vtysh_client[0], vty->buf); if (cmd_stat != CMD_SUCCESS) |