From: Chirag Shah Date: Sun, 26 Nov 2017 01:26:00 +0000 (-0800) Subject: ospfd: Running config to display VRF aware OSPF X-Git-Tag: frr-4.0-dev~125^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=88d771091b532ada60d2ca12038275d6e7bc0ac3;p=mirror%2Ffrr.git ospfd: Running config to display VRF aware OSPF 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 --- diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index fef274bba3..1f65ac23a7 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -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;