summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
authorPavel Ivashchenko <pivashchenko@nfware.com>2019-09-30 17:57:10 +0200
committerPavel Ivashchenko <pivashchenko@nfware.com>2019-10-08 14:18:15 +0200
commitd741915ecdcf8930ccb3bd23eec1da2f0d000483 (patch)
tree83fc05ef9745cb919a79a79177f10a8c03677322 /lib/command.c
parentMerge pull request #5009 from donaldsharp/interface_deletion (diff)
downloadfrr-d741915ecdcf8930ccb3bd23eec1da2f0d000483.tar.xz
frr-d741915ecdcf8930ccb3bd23eec1da2f0d000483.zip
vtysh: fix searching commands in parent nodes
Do not check parent command nodes in case of ambiguous and incomplete commands Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index 04f2bd95a..d126229f0 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1135,6 +1135,7 @@ int cmd_execute_command(vector vline, struct vty *vty,
return saved_ret;
if (ret != CMD_SUCCESS && ret != CMD_WARNING
+ && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
&& ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) {
/* This assumes all nodes above CONFIG_NODE are childs of
* CONFIG_NODE */
@@ -1146,6 +1147,7 @@ int cmd_execute_command(vector vline, struct vty *vty,
ret = cmd_execute_command_real(vline, FILTER_RELAXED,
vty, cmd);
if (ret == CMD_SUCCESS || ret == CMD_WARNING
+ || ret == CMD_ERR_AMBIGUOUS || ret == CMD_ERR_INCOMPLETE
|| ret == CMD_NOT_MY_INSTANCE
|| ret == CMD_WARNING_CONFIG_FAILED)
return ret;
@@ -1330,6 +1332,7 @@ int command_config_read_one_line(struct vty *vty,
if (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
&& ret != CMD_SUCCESS && ret != CMD_WARNING
+ && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
&& ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED
&& vty->node != CONFIG_NODE) {
int saved_node = vty->node;
@@ -1338,6 +1341,7 @@ int command_config_read_one_line(struct vty *vty,
while (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
&& ret != CMD_SUCCESS && ret != CMD_WARNING
+ && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
&& vty->node > CONFIG_NODE) {
vty->node = node_parent(vty->node);
if (vty->xpath_index > 0)