]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: adjust rp_keep_alive_time when register_suppress_time is changed
authorDon Slice <dslice@nvidia.com>
Fri, 23 Apr 2021 13:44:02 +0000 (06:44 -0700)
committerDon Slice <dslice@nvidia.com>
Wed, 5 May 2021 13:02:28 +0000 (09:02 -0400)
The router->register_suppress_time is used to derive the
rp_keep_alive_time, but when the suppress time was changed, pim was
not recalculating the rp_keep_alive_time and left it at the old value.
This fix applies the changes when a new suppress_time is entered
(or removed.)

Signed-off-by: Don Slice <dslice@nvidia.com>
pimd/pim_nb_config.c
pimd/pim_upstream.c
pimd/pim_upstream.h

index da2daea7c362604c5f036bfe22c30407603fe2b7..4598297f93b3c7e93689583caec7d80a85bcd8be 100644 (file)
@@ -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;
        }
 
index 9899172e6cefca138b8cdcaef8ee48bec42b59a7..918a9a9c7d7630e6f8840b22da3c279cbcf03000 100644 (file)
@@ -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)
 {
index adea3cd9efa25fd76b139b87f66a4f646b3e0ebe..56039d56057b02310d3bb622852dbfdaace0d6af 100644 (file)
@@ -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);