From 825d5fbf5912151be74560c11d178364fe6c0f3e Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Thu, 10 Aug 2017 10:13:36 -0700 Subject: [PATCH] lib: Fix multi instance ospf 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 --- lib/command.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/command.c b/lib/command.c index 077a72398d..45b5593a3e 100644 --- a/lib/command.c +++ b/lib/command.c @@ -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; -- 2.39.5