]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Running config to display VRF aware OSPF
authorChirag Shah <chirag@cumulusnetworks.com>
Sun, 26 Nov 2017 01:26:00 +0000 (17:26 -0800)
committerChirag Shah <chirag@cumulusnetworks.com>
Sun, 26 Nov 2017 02:26:31 +0000 (18:26 -0800)
show running-config to display VRF aware ospf instances
even if VRF is not active. This will allow the user to
configured ospf instances configurations even if VRF is not
active. 'show ip ospf vrf all' does not display until VRF
is active.

Ticket:CM-18949
Reviewed By:
Testing Done:
Configure non-default vrf aware ospfs with prior vrf devices
configured.
All vrf aware 'router ospf' displayed in running-configuration.
Disable one of the vrf device still all vrf aware 'router ospf'
displayed in running-config, but 'show ip ospf vrf all' does
not display for which VRF is not active.

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

index fef274bba35b42f2510fe9d422f123987d69d480..1f65ac23a7af6b06982054e1658966f5703c2422 100644 (file)
@@ -10061,7 +10061,14 @@ static int ospf_config_write(struct vty *vty)
                return write;
 
        for (ALL_LIST_ELEMENTS_RO(om->ospf, ospf_node, ospf)) {
-               if (ospf->oi_running)
+               /* VRF Default check if it is running.
+                * Upon daemon start, there could be default instance
+                * in absence of 'router ospf'/oi_running is disabled. */
+               if (ospf->vrf_id == VRF_DEFAULT && ospf->oi_running)
+                       write += ospf_config_write_one(vty, ospf);
+               /* For Non-Default VRF simply display the configuration,
+                * even if it is not oi_running. */
+               else if (ospf->vrf_id != VRF_DEFAULT)
                        write += ospf_config_write_one(vty, ospf);
        }
        return write;