summaryrefslogtreecommitdiff
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
commit87d683b071dc7abfb30b666960ec480e64e19ce4 (patch)
treeec56b3ce34f6871c4b3687681df2b97aa38da57a /lib/command.c
parentb854038bd03e6c54b46d35bf4e40d0f39e30dfde (diff)
* 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.c8
1 files changed, 6 insertions, 2 deletions
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 )