Skip to content

Commit

Permalink
lib, zebra: fix exit commands
Browse files Browse the repository at this point in the history
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 FRRouting#15706.

Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Apr 16, 2024
1 parent 84d1fb1 commit 57811a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lib/vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 57811a5

Please sign in to comment.