diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-05-09 19:31:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-09 19:31:36 +0200 |
commit | 466623224712f03771a4cb9594c1b0fc76e8ab8d (patch) | |
tree | d9db4cdbcc86479c9b477c7ea32fa0858d2420e5 | |
parent | Merge pull request #8380 from mjstapp/nexthop_cmp_basic (diff) | |
parent | pimd: adjust rp_keep_alive_time when register_suppress_time is changed (diff) | |
download | frr-466623224712f03771a4cb9594c1b0fc76e8ab8d.tar.xz frr-466623224712f03771a4cb9594c1b0fc76e8ab8d.zip |
Merge pull request #8631 from dslicenc/pimd-timer-fix
-rw-r--r-- | pimd/pim_cmd.c | 9 | ||||
-rw-r--r-- | pimd/pim_nb_config.c | 4 | ||||
-rw-r--r-- | pimd/pim_upstream.c | 22 | ||||
-rw-r--r-- | pimd/pim_upstream.h | 1 | ||||
-rw-r--r-- | pimd/pim_vty.c | 33 |
5 files changed, 45 insertions, 24 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index d2f7dad82..90aa15bee 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -7213,7 +7213,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); vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) @@ -11090,9 +11091,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); @@ -11105,9 +11104,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); @@ -11117,9 +11114,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_nb_config.c b/pimd/pim_nb_config.c index da2daea7c..4598297f9 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -763,8 +763,8 @@ int pim_register_suppress_time_modify(struct nb_cb_modify_args *args) case NB_EV_ABORT: break; case NB_EV_APPLY: - router->register_suppress_time = - yang_dnode_get_uint16(args->dnode, NULL); + pim_update_suppress_timers( + yang_dnode_get_uint16(args->dnode, NULL)); break; } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 9899172e6..918a9a9c7 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -407,6 +407,28 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up, &up->t_join_timer); } +void pim_update_suppress_timers(uint32_t suppress_time) +{ + struct pim_instance *pim; + struct vrf *vrf; + unsigned int old_rp_ka_time; + + /* stash the old one so we know which values were manually configured */ + old_rp_ka_time = (3 * router->register_suppress_time + + router->register_probe_time); + router->register_suppress_time = suppress_time; + + RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { + pim = vrf->info; + if (!pim) + continue; + + /* Only adjust if not manually configured */ + if (pim->rp_keep_alive_time == old_rp_ka_time) + pim->rp_keep_alive_time = PIM_RP_KEEPALIVE_PERIOD; + } +} + void pim_upstream_join_suppress(struct pim_upstream *up, struct in_addr rpf_addr, int holdtime) { diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index adea3cd9e..56039d560 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -317,6 +317,7 @@ int pim_upstream_eval_inherit_if(struct pim_upstream *up, void pim_upstream_update_join_desired(struct pim_instance *pim, struct pim_upstream *up); +void pim_update_suppress_timers(uint32_t suppress_time); void pim_upstream_join_suppress(struct pim_upstream *up, struct in_addr rpf_addr, int holdtime); diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 76e9c3f0a..929d35101 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -186,16 +186,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, @@ -207,11 +215,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); |