From bb4b6eb54714cb8c93bb63a84bd3bccfae87a10a Mon Sep 17 00:00:00 2001 From: Don Slice Date: Mon, 3 May 2021 14:59:01 -0400 Subject: pimd: stop displaying global parameters in each vrf Problem reported that when certain pim commands were entered, they showed up duplicated in the configuration both under default instance and every vrf (whether pim was used there or not.) This was because these particular parameters are global only and the function doing the display would repeat for each vrf. This fix only displays those in the default case (and removes them from the help for entering under a vrf.) Signed-off-by: Don Slice --- pimd/pim_vty.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'pimd/pim_vty.c') diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 57a0c6916..8154feb0f 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -185,16 +185,24 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty) writes += pim_rp_config_write(pim, vty, spaces); - if (router->register_suppress_time - != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { - vty_out(vty, "%sip pim register-suppress-time %d\n", spaces, - router->register_suppress_time); - ++writes; - } - if (router->t_periodic != PIM_DEFAULT_T_PERIODIC) { - vty_out(vty, "%sip pim join-prune-interval %d\n", spaces, - router->t_periodic); - ++writes; + if (pim->vrf_id == VRF_DEFAULT) { + if (router->register_suppress_time + != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { + vty_out(vty, "%sip pim register-suppress-time %d\n", + spaces, router->register_suppress_time); + ++writes; + } + if (router->t_periodic != PIM_DEFAULT_T_PERIODIC) { + vty_out(vty, "%sip pim join-prune-interval %d\n", + spaces, router->t_periodic); + ++writes; + } + + if (router->packet_process != PIM_DEFAULT_PACKET_PROCESS) { + vty_out(vty, "%sip pim packets %d\n", spaces, + router->packet_process); + ++writes; + } } if (pim->keep_alive_time != PIM_KEEPALIVE_PERIOD) { vty_out(vty, "%sip pim keep-alive-timer %d\n", spaces, @@ -206,11 +214,6 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty) pim->rp_keep_alive_time); ++writes; } - if (router->packet_process != PIM_DEFAULT_PACKET_PROCESS) { - vty_out(vty, "%sip pim packets %d\n", spaces, - router->packet_process); - ++writes; - } if (ssm->plist_name) { vty_out(vty, "%sip pim ssm prefix-list %s\n", spaces, ssm->plist_name); -- cgit v1.2.3