]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Handle multi instance router ospf command
authorChirag Shah <chirag@cumulusnetworks.com>
Sat, 5 Aug 2017 05:55:20 +0000 (22:55 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Sat, 5 Aug 2017 05:59:40 +0000 (22:59 -0700)
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
ospfd/ospf_vty.c

index f7a512951f868b2e13c5e84b35ce4ed79ab9ec6e..78f965abbfc3e531ecbda68518e671b213ca6ba7 100644 (file)
@@ -135,6 +135,7 @@ DEFUN_NOSH (router_ospf,
 {
        struct ospf *ospf;
        u_short instance = 0;
+       int ret = CMD_SUCCESS;
 
        ospf = ospf_lookup();
        if (!ospf) {
@@ -147,9 +148,10 @@ DEFUN_NOSH (router_ospf,
 
        /* The following logic to set the vty qobj index is in place to be able
           to ignore the commands which dont belong to this instance. */
-       if (ospf->instance != instance)
+       if (ospf->instance != instance) {
                VTY_PUSH_CONTEXT_NULL(OSPF_NODE);
-       else {
+               ret = CMD_NOT_MY_INSTANCE;
+       } else {
                if (IS_DEBUG_OSPF_EVENT)
                        zlog_debug("Config command 'router ospf %d' received",
                                   instance);
@@ -158,7 +160,7 @@ DEFUN_NOSH (router_ospf,
                ospf_router_id_update(ospf);
        }
 
-       return CMD_SUCCESS;
+       return ret;
 }
 
 DEFUN (no_router_ospf,