mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge pull request #15975 from opensourcerouting/pim-fixes-20240508
pimd: fixes split off from #15969
This commit is contained in:
commit
0c9ce7a862
|
@ -211,7 +211,7 @@ is in a vrf, enter the interface command with the vrf keyword at the end.
|
|||
messages. This is enabled by default. 'no' form of this command is used to
|
||||
restrict processing of unicast bsm messages on this interface.
|
||||
|
||||
.. clicmd:: ip pim drpriority (1-4294967295)
|
||||
.. clicmd:: ip pim drpriority (0-4294967295)
|
||||
|
||||
Set the DR Priority for the interface. This command is useful to allow the
|
||||
user to influence what node becomes the DR for a lan segment.
|
||||
|
|
|
@ -135,7 +135,7 @@ is in a vrf, enter the interface command with the vrf keyword at the end.
|
|||
command will not do anything if you do not have the underlying ability
|
||||
of a mlag implementation.
|
||||
|
||||
.. clicmd:: ipv6 pim drpriority (1-4294967295)
|
||||
.. clicmd:: ipv6 pim drpriority (0-4294967295)
|
||||
|
||||
Set the DR Priority for the interface. This command is useful to allow the
|
||||
user to influence what node becomes the DR for a lan segment.
|
||||
|
|
|
@ -244,7 +244,7 @@ DEFPY (interface_no_ipv6_pim,
|
|||
|
||||
DEFPY (interface_ipv6_pim_drprio,
|
||||
interface_ipv6_pim_drprio_cmd,
|
||||
"ipv6 pim drpriority (1-4294967295)",
|
||||
"ipv6 pim drpriority (0-4294967295)",
|
||||
IPV6_STR
|
||||
PIM_STR
|
||||
"Set the Designated Router Election Priority\n"
|
||||
|
@ -255,7 +255,7 @@ DEFPY (interface_ipv6_pim_drprio,
|
|||
|
||||
DEFPY (interface_no_ipv6_pim_drprio,
|
||||
interface_no_ipv6_pim_drprio_cmd,
|
||||
"no ipv6 pim drpriority [(1-4294967295)]",
|
||||
"no ipv6 pim drpriority [(0-4294967295)]",
|
||||
NO_STR
|
||||
IPV6_STR
|
||||
PIM_STR
|
||||
|
|
|
@ -3956,7 +3956,7 @@ DEFUN (interface_no_ip_igmp_last_member_query_interval,
|
|||
|
||||
DEFUN (interface_ip_pim_drprio,
|
||||
interface_ip_pim_drprio_cmd,
|
||||
"ip pim drpriority (1-4294967295)",
|
||||
"ip pim drpriority (0-4294967295)",
|
||||
IP_STR
|
||||
PIM_STR
|
||||
"Set the Designated Router Election Priority\n"
|
||||
|
@ -3969,7 +3969,7 @@ DEFUN (interface_ip_pim_drprio,
|
|||
|
||||
DEFUN (interface_no_ip_pim_drprio,
|
||||
interface_no_ip_pim_drprio_cmd,
|
||||
"no ip pim drpriority [(1-4294967295)]",
|
||||
"no ip pim drpriority [(0-4294967295)]",
|
||||
NO_STR
|
||||
IP_STR
|
||||
PIM_STR
|
||||
|
|
|
@ -342,6 +342,13 @@ void pim_ifchannel_ifjoin_switch(const char *caller, struct pim_ifchannel *ch,
|
|||
ch->sg_str, ch->interface->name);
|
||||
}
|
||||
|
||||
/* pim_upstream_update_join_desired looks at up->channel_oil,
|
||||
* but that's updated from pim_forward_stop(). Need this here
|
||||
* so we correctly determine join_desired right below.
|
||||
*/
|
||||
if (new_state == PIM_IFJOIN_NOINFO)
|
||||
pim_forward_stop(ch);
|
||||
|
||||
/*
|
||||
Record uptime of state transition to/from NOINFO
|
||||
*/
|
||||
|
@ -619,7 +626,6 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, pim_sgaddr *sg,
|
|||
static void ifjoin_to_noinfo(struct pim_ifchannel *ch)
|
||||
{
|
||||
pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO);
|
||||
pim_forward_stop(ch);
|
||||
|
||||
PIM_UPSTREAM_FLAG_UNSET_SRC_PIM(ch->upstream->flags);
|
||||
|
||||
|
|
|
@ -109,12 +109,12 @@ static void pim_reg_stop_upstream(struct pim_instance *pim,
|
|||
up->reg_state = PIM_REG_PRUNE;
|
||||
pim_channel_del_oif(up->channel_oil, pim->regiface,
|
||||
PIM_OIF_FLAG_PROTO_PIM, __func__);
|
||||
pim_upstream_start_register_stop_timer(up, 0);
|
||||
pim_upstream_start_register_probe_timer(up);
|
||||
pim_vxlan_update_sg_reg_state(pim, up, false);
|
||||
break;
|
||||
case PIM_REG_JOIN_PENDING:
|
||||
up->reg_state = PIM_REG_PRUNE;
|
||||
pim_upstream_start_register_stop_timer(up, 0);
|
||||
pim_upstream_start_register_probe_timer(up);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -331,8 +331,7 @@ int pim_upstream_is_sg_rpt(struct pim_upstream *up);
|
|||
void pim_upstream_set_sptbit(struct pim_upstream *up,
|
||||
struct interface *incoming);
|
||||
|
||||
void pim_upstream_start_register_stop_timer(struct pim_upstream *up,
|
||||
int null_register);
|
||||
void pim_upstream_start_register_probe_timer(struct pim_upstream *up);
|
||||
|
||||
void pim_upstream_send_join(struct pim_upstream *up);
|
||||
|
||||
|
|
|
@ -422,9 +422,7 @@ module frr-pim {
|
|||
}
|
||||
|
||||
leaf dr-priority {
|
||||
type uint32 {
|
||||
range "1..max";
|
||||
}
|
||||
type uint32;
|
||||
default 1;
|
||||
description
|
||||
"DR (Designated Router) priority";
|
||||
|
|
Loading…
Reference in a new issue