summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
authorhasso <hasso>2005-01-16 23:31:54 +0000
committerhasso <hasso>2005-01-16 23:31:54 +0000
commitdab45eeed68d0a63c4843699a86bdf10e2ec9db4 (patch)
tree9c5da5cce377aa38c60f3f5f62632e7b35bd40ec /lib/command.c
parentd71a3efe0bd0d9fb9b17b795f8e59bdd97c4406a (diff)
downloadquagga-dab45eeed68d0a63c4843699a86bdf10e2ec9db4.tar.bz2
quagga-dab45eeed68d0a63c4843699a86bdf10e2ec9db4.tar.xz
* 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]
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 )