diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:55:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:55:46 +0000 |
commit | 4f40546c96c6aeaa4371161dca9db21071bcc5d2 (patch) | |
tree | 41199f3c71bb1b62bdee8e83577351f6ee70d031 /pimd/pim_upstream.c | |
parent | Adding upstream version 10.0. (diff) | |
download | frr-4f40546c96c6aeaa4371161dca9db21071bcc5d2.tar.xz frr-4f40546c96c6aeaa4371161dca9db21071bcc5d2.zip |
Adding upstream version 10.0.1.upstream/10.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | pimd/pim_upstream.c | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 556d25b..7417f31 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -1687,6 +1687,8 @@ const char *pim_reg_state2str(enum pim_reg_state reg_state, char *state_str, return state_str; } +static void pim_upstream_start_register_stop_timer(struct pim_upstream *up); + static void pim_upstream_register_stop_timer(struct event *t) { struct pim_interface *pim_ifp; @@ -1734,7 +1736,7 @@ static void pim_upstream_register_stop_timer(struct event *t) return; } up->reg_state = PIM_REG_JOIN_PENDING; - pim_upstream_start_register_stop_timer(up, 1); + pim_upstream_start_register_stop_timer(up); if (((up->channel_oil->cc.lastused / 100) > pim->keep_alive_time) @@ -1752,34 +1754,59 @@ static void pim_upstream_register_stop_timer(struct event *t) } } -void pim_upstream_start_register_stop_timer(struct pim_upstream *up, - int null_register) +static void pim_upstream_start_register_stop_timer(struct pim_upstream *up) { uint32_t time; EVENT_OFF(up->t_rs_timer); - if (!null_register) { - uint32_t lower = (0.5 * router->register_suppress_time); - uint32_t upper = (1.5 * router->register_suppress_time); - time = lower + (frr_weak_random() % (upper - lower + 1)); - /* Make sure we don't wrap around */ - if (time >= router->register_probe_time) - time -= router->register_probe_time; - else - time = 0; - } else - time = router->register_probe_time; + time = router->register_probe_time; - if (PIM_DEBUG_PIM_TRACE) { - zlog_debug( - "%s: (S,G)=%s Starting upstream register stop timer %d", - __func__, up->sg_str, time); - } + if (PIM_DEBUG_PIM_TRACE) + zlog_debug("%s: (S,G)=%s Starting upstream register stop timer %d", + __func__, up->sg_str, time); event_add_timer(router->master, pim_upstream_register_stop_timer, up, time, &up->t_rs_timer); } +static void pim_upstream_register_probe_timer(struct event *t) +{ + struct pim_upstream *up = EVENT_ARG(t); + + if (!up->rpf.source_nexthop.interface || + !up->rpf.source_nexthop.interface->info) { + if (PIM_DEBUG_PIM_REG) + zlog_debug("cannot send Null register for %pSG, no path to RP", + &up->sg); + } else + pim_null_register_send(up); + + pim_upstream_start_register_stop_timer(up); +} + +void pim_upstream_start_register_probe_timer(struct pim_upstream *up) +{ + uint32_t time; + + EVENT_OFF(up->t_rs_timer); + + uint32_t lower = (0.5 * router->register_suppress_time); + uint32_t upper = (1.5 * router->register_suppress_time); + time = lower + (frr_weak_random() % (upper - lower + 1)); + /* Make sure we don't wrap around */ + if (time >= router->register_probe_time) + time -= router->register_probe_time; + else + time = 0; + + if (PIM_DEBUG_PIM_TRACE) + zlog_debug("%s: (S,G)=%s Starting upstream register stop null probe timer %d", + __func__, up->sg_str, time); + + event_add_timer(router->master, pim_upstream_register_probe_timer, up, + time, &up->t_rs_timer); +} + int pim_upstream_inherited_olist_decide(struct pim_instance *pim, struct pim_upstream *up) { |