]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, zebra: fix exit commands 15785/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 16 Apr 2024 19:10:45 +0000 (22:10 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 18 Apr 2024 06:34:21 +0000 (06:34 +0000)
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 <iryzhov@nfware.com>
(cherry picked from commit 57811a53ba65f755cb2ff9cdc682b8a249144ffa)

lib/command.c
lib/vrf.c
zebra/zebra_cli.c

index fa260721dcb2622d61c4fea37c9f03d57519030b..8f780d0ead5de01d0a01b0a3e4a6fb58cc3add30 100644 (file)
@@ -1356,7 +1356,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")
index e907626bae59d9ea463f3ac145111cc5f2bab9bc..31632a80d5e5d7f0223d2c89ca2bb84eddc8d8f0 100644 (file)
--- 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")
index 00e0a49cb8f29c9a0066f4b9455c79f7da84dc92..3e03d7477575e29f7a3fd48e2240502ef25e3d63 100644 (file)
@@ -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")