]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Fix multi instance ospf
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 10 Aug 2017 17:13:36 +0000 (10:13 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Thu, 10 Aug 2017 21:59:07 +0000 (14:59 -0700)
ospfd crashes upon configuring multi-instance ospf
i.e 'router ospf x'.
ospfd can return CMD_NOT_MY_INSTANCE which
is not supported in lib/commands

Support two of the error codes
CMD_NOT_MY_INSTANCE and CMD_WARNING_CONFIG_FAILED

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
lib/command.c

index 077a72398ded9333ed8afcfde3cb9763aaddbd83..45b5593a3e8c675c5368c1b102e6a8978559964b 100644 (file)
@@ -1062,7 +1062,8 @@ int cmd_execute_command(vector vline, struct vty *vty,
        if (vtysh)
                return saved_ret;
 
-       if (ret != CMD_SUCCESS && ret != CMD_WARNING) {
+       if (ret != CMD_SUCCESS && ret != CMD_WARNING
+           && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) {
                /* This assumes all nodes above CONFIG_NODE are childs of
                 * CONFIG_NODE */
                while (vty->node > CONFIG_NODE) {
@@ -1070,7 +1071,9 @@ int cmd_execute_command(vector vline, struct vty *vty,
                        vty->node = try_node;
                        ret = cmd_execute_command_real(vline, FILTER_RELAXED,
                                                       vty, cmd);
-                       if (ret == CMD_SUCCESS || ret == CMD_WARNING)
+                       if (ret == CMD_SUCCESS || ret == CMD_WARNING
+                           || ret == CMD_NOT_MY_INSTANCE
+                           || ret == CMD_WARNING_CONFIG_FAILED)
                                return ret;
                }
                /* no command succeeded, reset the vty to the original node */
@@ -1134,6 +1137,8 @@ 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_NOT_MY_INSTANCE
+           && ret != CMD_WARNING_CONFIG_FAILED
            && vty->node != CONFIG_NODE) {
 
                saved_node = vty->node;