From 57811a53ba65f755cb2ff9cdc682b8a249144ffa Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 16 Apr 2024 22:10:45 +0300 Subject: [PATCH] lib, zebra: fix exit commands If a command is not marked as `YANG`-converted, the current command batching buffer is flushed before executing the command. We shouldn't flush the buffer when executing an `exit` command. It should only be flushed if the next command is not `YANG`-converted, which is checked by the command itself, not the previous `exit`. Fixes #15706. Signed-off-by: Igor Ryzhov --- lib/command.c | 2 +- lib/vrf.c | 2 +- zebra/zebra_cli.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/command.c b/lib/command.c index 0288ab75995b..51f2529e3ead 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1374,7 +1374,7 @@ DEFUN (disable, } /* Down vty node level. */ -DEFUN (config_exit, +DEFUN_YANG (config_exit, config_exit_cmd, "exit", "Exit current mode and down to previous mode\n") diff --git a/lib/vrf.c b/lib/vrf.c index e907626bae59..31632a80d5e5 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -636,7 +636,7 @@ int vrf_configure_backend(enum vrf_backend_type backend) } /* vrf CLI commands */ -DEFUN_NOSH(vrf_exit, +DEFUN_YANG_NOSH (vrf_exit, vrf_exit_cmd, "exit-vrf", "Exit current mode and down to previous mode\n") diff --git a/zebra/zebra_cli.c b/zebra/zebra_cli.c index 00e0a49cb8f2..3e03d7477575 100644 --- a/zebra/zebra_cli.c +++ b/zebra/zebra_cli.c @@ -241,7 +241,7 @@ DEFUN_YANG_NOSH (link_params, return ret; } -DEFUN_NOSH (exit_link_params, +DEFUN_YANG_NOSH (exit_link_params, exit_link_params_cmd, "exit-link-params", "Exit from Link Params configuration mode\n")