From 87d683b071dc7abfb30b666960ec480e64e19ce4 Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 16 Jan 2005 23:31:54 +0000 Subject: * command.[ch], vty.c: cmd_execute_command() function must not attempt to walk up in the node tree if called from vtysh. Different daemons might have commands with same syntax in different nodes (for example "router-id x.x.x.x" commands in zebra/ospfd/ospf6d daemons). * vtysh.c: Reflect changes in lib. cmd_execute_command() should know now that it's called from vtysh and must not attempt to walk up in the node tree. [pullup candidate] --- lib/command.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 92bbac75..8f9b98e5 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1,5 +1,5 @@ /* - $Id: command.c,v 1.33 2005/01/14 17:09:38 ajs Exp $ + $Id: command.c,v 1.34 2005/01/16 23:31:54 hasso Exp $ Command interpreter routine for virtual terminal [aka TeletYpe] Copyright (C) 1997, 98, 99 Kunihiro Ishiguro @@ -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 ) -- cgit v1.2.1