From 88d771091b532ada60d2ca12038275d6e7bc0ac3 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Sat, 25 Nov 2017 17:26:00 -0800 Subject: [PATCH] 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 --- ospfd/ospf_vty.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.39.5