]> git.proxmox.com Git - mirror_frr.git/commitdiff
vtysh: fix searching commands in parent nodes
authorPavel Ivashchenko <pivashchenko@nfware.com>
Mon, 30 Sep 2019 15:57:10 +0000 (15:57 +0000)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 29 Apr 2021 15:35:07 +0000 (18:35 +0300)
  Do not check parent command nodes in case of ambiguous and incomplete commands

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
lib/command.c
vtysh/vtysh.c

index 7fb405bdfbb417086dd2802e56acd00e3ff2d588..2f0736746912ecae008ba7147cf18508db905fb3 100644 (file)
@@ -1049,6 +1049,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 */
@@ -1062,6 +1063,7 @@ int cmd_execute_command(vector vline, struct vty *vty,
                        ret = cmd_execute_command_real(vline, FILTER_RELAXED,
                                                       vty, cmd, 0);
                        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;
@@ -1260,6 +1262,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
               && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED
               && ret != CMD_NO_LEVEL_UP)
                ret = cmd_execute_command_real(vline, FILTER_STRICT, vty, cmd,
index a1417430ec47621b055d8ad156b8387316a8ea59..2abc184bc24f8a536c63b0eb13e43c40f0fb855f 100644 (file)
@@ -493,6 +493,7 @@ static int vtysh_execute_func(const char *line, int pager)
         */
        while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
               && ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
+              && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
               && vty->node > CONFIG_NODE) {
                vty->node = node_parent(vty->node);
                ret = cmd_execute(vty, line, &cmd, 1);
@@ -794,6 +795,7 @@ int vtysh_mark_file(const char *filename)
                 */
                while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
                       && ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
+                      && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
                       && vty->node > CONFIG_NODE) {
                        vty->node = node_parent(vty->node);
                        ret = cmd_execute_command_strict(vline, vty, &cmd);