summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-08-10 10:13:36 -0700
committerChirag Shah <chirag@cumulusnetworks.com>2017-08-10 14:59:07 -0700
commit825d5fbf5912151be74560c11d178364fe6c0f3e (patch)
tree252284eb3c7d5ba61041a14db2e18dc97d4c5271 /lib/command.c
parentc93d2f48451401121d4f647aae3fe61e44fc085c (diff)
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 <chirag@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c9
1 files 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;