summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/command.c b/lib/command.c
index 004b087b..1d6388cb 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2092,7 +2092,8 @@ cmd_execute_command_real (vector vline, struct vty *vty, struct cmd_element **cm
int
-cmd_execute_command (vector vline, struct vty *vty, struct cmd_element **cmd) {
+cmd_execute_command (vector vline, struct vty *vty, struct cmd_element **cmd,
+ int vtysh) {
int ret, saved_ret, tried = 0;
enum node_type onode, try_node;
@@ -2123,6 +2124,9 @@ cmd_execute_command (vector vline, struct vty *vty, struct cmd_element **cmd) {
saved_ret = ret = cmd_execute_command_real (vline, vty, cmd);
+ if (vtysh)
+ return saved_ret;
+
/* This assumes all nodes above CONFIG_NODE are childs of CONFIG_NODE */
while ( ret != CMD_SUCCESS && ret != CMD_WARNING
&& vty->node > CONFIG_NODE )