summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDon Slice <dslice@nvidia.com>2021-05-03 20:59:01 +0200
committerDon Slice <dslice@nvidia.com>2021-05-05 14:11:27 +0200
commitbb4b6eb54714cb8c93bb63a84bd3bccfae87a10a (patch)
treea4bc16139b90787442852b2434944b1d66ba5945 /pimd
parentMerge pull request #8545 from opensourcerouting/assert-our-own (diff)
downloadfrr-bb4b6eb54714cb8c93bb63a84bd3bccfae87a10a.tar.xz
frr-bb4b6eb54714cb8c93bb63a84bd3bccfae87a10a.zip
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 <dslice@nvidia.com>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c9
-rw-r--r--pimd/pim_vty.c33
2 files changed, 20 insertions, 22 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index c01cfec88..b91078ea7 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -7276,7 +7276,8 @@ DEFUN (no_ip_pim_rp_keep_alive,
char rp_ka_timer[5];
char rp_ka_timer_xpath[XPATH_MAXLEN];
- snprintf(rp_ka_timer, sizeof(rp_ka_timer), "%d", PIM_KEEPALIVE_PERIOD);
+ snprintf(rp_ka_timer, sizeof(rp_ka_timer), "%d",
+ PIM_RP_KEEPALIVE_PERIOD);
if (vty->xpath_index) {
vrf_dnode =
@@ -11412,9 +11413,7 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &ip_pim_ssm_prefix_list_cmd);
install_element(VRF_NODE, &ip_pim_ssm_prefix_list_cmd);
install_element(CONFIG_NODE, &ip_pim_register_suppress_cmd);
- install_element(VRF_NODE, &ip_pim_register_suppress_cmd);
install_element(CONFIG_NODE, &no_ip_pim_register_suppress_cmd);
- install_element(VRF_NODE, &no_ip_pim_register_suppress_cmd);
install_element(CONFIG_NODE, &ip_pim_spt_switchover_infinity_cmd);
install_element(VRF_NODE, &ip_pim_spt_switchover_infinity_cmd);
install_element(CONFIG_NODE, &ip_pim_spt_switchover_infinity_plist_cmd);
@@ -11427,9 +11426,7 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &pim_register_accept_list_cmd);
install_element(VRF_NODE, &pim_register_accept_list_cmd);
install_element(CONFIG_NODE, &ip_pim_joinprune_time_cmd);
- install_element(VRF_NODE, &ip_pim_joinprune_time_cmd);
install_element(CONFIG_NODE, &no_ip_pim_joinprune_time_cmd);
- install_element(VRF_NODE, &no_ip_pim_joinprune_time_cmd);
install_element(CONFIG_NODE, &ip_pim_keep_alive_cmd);
install_element(VRF_NODE, &ip_pim_keep_alive_cmd);
install_element(CONFIG_NODE, &ip_pim_rp_keep_alive_cmd);
@@ -11439,9 +11436,7 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &no_ip_pim_rp_keep_alive_cmd);
install_element(VRF_NODE, &no_ip_pim_rp_keep_alive_cmd);
install_element(CONFIG_NODE, &ip_pim_packets_cmd);
- install_element(VRF_NODE, &ip_pim_packets_cmd);
install_element(CONFIG_NODE, &no_ip_pim_packets_cmd);
- install_element(VRF_NODE, &no_ip_pim_packets_cmd);
install_element(CONFIG_NODE, &ip_pim_v6_secondary_cmd);
install_element(VRF_NODE, &ip_pim_v6_secondary_cmd);
install_element(CONFIG_NODE, &no_ip_pim_v6_secondary_cmd);
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);