Commit bb65893f91 for frr
commit bb65893f911169653d4a50fa3d3bb6fa7205df45
Author: Dave Seddon <dave.seddon.ca@gmail.com>
Date: Sun Nov 8 13:43:49 2026 -0800
pimd: set the State Refresh prune indicator for pruned interfaces
pim_send_staterefresh() and pim_staterefresh_recv() stored
PIM_UPSTREAM_DM_TEST_PRUNE(ch->flags), bit 23, in a uint8_t, which
truncated it to 0. So State Refresh messages never carried the Prune
Indicator (RFC 3973 4.7.10), and forwarding one never reset a pruned
interface's Prune Timer (4.5.1), so the interface could time out and
resume flooding.
Declare p (and n) as bool. Also correct the forwarding comment, which
cited 4.5.2 (origination) instead of 4.5.1.
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
diff --git a/pimd/pim_state_refresh.c b/pimd/pim_state_refresh.c
index 1f0dec35c9..36ec790d85 100644
--- a/pimd/pim_state_refresh.c
+++ b/pimd/pim_state_refresh.c
@@ -40,7 +40,7 @@ int pim_staterefresh_recv(struct interface *ifp, pim_addr src_addr, uint8_t *buf
struct listnode *neighnode;
struct pim_neighbor *neigh;
uint8_t pim_msg[1000];
- uint8_t p;
+ bool p;
int pim_msg_size;
struct pim_upstream *up;
@@ -157,7 +157,7 @@ int pim_staterefresh_recv(struct interface *ifp, pim_addr src_addr, uint8_t *buf
/* TODO: condition StateRefreshRateLimit(S,G) not implemented yet!! */
/*
- * RFC 3973 4.5.2: forward the State Refresh on every downstream PIM
+ * RFC 3973 4.5.1: forward the State Refresh on every downstream PIM
* dense-mode interface, i.e. all PIM interfaces except the one the
* message arrived on. Iterating the receiving interface's neighbor list
* would only echo it back onto the incoming segment.
@@ -176,7 +176,7 @@ int pim_staterefresh_recv(struct interface *ifp, pim_addr src_addr, uint8_t *buf
pim_ifchannel_find(ifp2, &up->sg, &ch, &throwaway);
if (!ch)
- p = 0;
+ p = false;
else {
if (pim_macro_ch_lost_assert(ch))
continue;
@@ -286,7 +286,7 @@ int pim_staterefresh_build_msg(uint8_t *pim_msg, int buf_size, struct interface
void pim_send_staterefresh(struct pim_upstream *up)
{
uint8_t pim_msg[1000];
- uint8_t p, n;
+ bool p, n;
int pim_msg_size;
struct interface *ifp, *ifp2 = NULL;
struct pim_interface *pim_ifp2;
@@ -319,7 +319,7 @@ void pim_send_staterefresh(struct pim_upstream *up)
if (HAVE_DENSE_MODE(pim_ifp2->pim_mode) && ifp2->ifindex != ifp->ifindex) {
pim_ifchannel_find(ifp2, &up->sg, &ch, &throwaway);
if (!ch)
- p = 0;
+ p = false;
else
p = PIM_UPSTREAM_DM_TEST_PRUNE(ch->flags);