summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/user/pim.rst2
-rw-r--r--doc/user/pimv6.rst2
-rw-r--r--pimd/pim6_cmd.c4
-rw-r--r--pimd/pim_cmd.c4
-rw-r--r--pimd/pim_ifchannel.c8
-rw-r--r--pimd/pim_register.c4
-rw-r--r--pimd/pim_upstream.c57
-rw-r--r--pimd/pim_upstream.h3
-rw-r--r--yang/frr-pim.yang4
9 files changed, 60 insertions, 28 deletions
diff --git a/doc/user/pim.rst b/doc/user/pim.rst
index 44ade916a2..29194663e3 100644
--- a/doc/user/pim.rst
+++ b/doc/user/pim.rst
@@ -212,7 +212,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.
diff --git a/doc/user/pimv6.rst b/doc/user/pimv6.rst
index 843734e217..46d22143fa 100644
--- a/doc/user/pimv6.rst
+++ b/doc/user/pimv6.rst
@@ -136,7 +136,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.
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c
index dc84de6bfd..32996e6e2a 100644
--- a/pimd/pim6_cmd.c
+++ b/pimd/pim6_cmd.c
@@ -259,7 +259,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"
@@ -270,7 +270,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
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index c2f7396c18..2a46c5eafe 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -4052,7 +4052,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"
@@ -4065,7 +4065,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
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 3310009c02..c26f318f98 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -355,6 +355,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
*/
@@ -632,7 +639,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);
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 9ccdae13bc..d4eb88e75b 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -123,12 +123,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;
}
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index be575ee1ec..749790fb97 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -1692,6 +1692,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 thread *t)
{
struct pim_interface *pim_ifp;
@@ -1738,7 +1740,7 @@ static void pim_upstream_register_stop_timer(struct thread *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)
@@ -1756,24 +1758,13 @@ static void pim_upstream_register_stop_timer(struct thread *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;
THREAD_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(
@@ -1784,6 +1775,44 @@ void pim_upstream_start_register_stop_timer(struct pim_upstream *up,
time, &up->t_rs_timer);
}
+static void pim_upstream_register_probe_timer(struct thread *t)
+{
+ struct pim_upstream *up = THREAD_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;
+
+ THREAD_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);
+
+ thread_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)
{
diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h
index 15c4fcfe7e..a7611b0489 100644
--- a/pimd/pim_upstream.h
+++ b/pimd/pim_upstream.h
@@ -344,8 +344,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);
diff --git a/yang/frr-pim.yang b/yang/frr-pim.yang
index 9e40d78602..b5c4d3501e 100644
--- a/yang/frr-pim.yang
+++ b/yang/frr-pim.yang
@@ -421,9 +421,7 @@ module frr-pim {
}
leaf dr-priority {
- type uint32 {
- range "1..max";
- }
+ type uint32;
default 1;
description
"DR (Designated Router) priority";