summaryrefslogtreecommitdiff
path: root/pimd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-12-12 17:50:59 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-09 13:54:47 +0000
commitab19bee70181d0a2a927416827d2f0f3aee68094 (patch)
tree083b3c3b2e777048f1937c52bb1e60ed1ed04b42 /pimd
parentac8616aab72239590a82dbf5745847779be53559 (diff)
pimd: fix order of operations for evaluating join
join_desired looks at whether up->channel_oil is empty. up->channel_oil is updated from pim_forward_stop(), calling pim_channel_del_oif(). But that was being called *after* updating join_desired, so join_desired saw a non-empty OIL. Pull up the pim_forward_stop() call to before updating join_desired. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit fdb1a6fed5a8e42447b5b9633ad9df0f3042d0a9)
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_ifchannel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index da55189941..8f9e41039a 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -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);