summaryrefslogtreecommitdiffstats
path: root/pimd/pim_ifchannel.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-08-15 17:39:14 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-08-15 21:45:05 +0200
commit29b458ef1f72c9b117cb603dd74ab3aec49e21ae (patch)
tree10a51fd28d52b6aacaa47b923f4c7dcc3896f457 /pimd/pim_ifchannel.c
parentnhrpd: Use frr_weak_random() (diff)
downloadfrr-29b458ef1f72c9b117cb603dd74ab3aec49e21ae.tar.xz
frr-29b458ef1f72c9b117cb603dd74ab3aec49e21ae.zip
pimd: ch->upstream cannot be NULL
in pim_ifchannel.c there exists several spots where the ch->upstream is assumed to be NULL. This is not possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to '')
-rw-r--r--pimd/pim_ifchannel.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index ac2eee0a3..ce252366c 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -539,10 +539,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, pim_sgaddr *sg,
if (up_flags == PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
PIM_IF_FLAG_SET_PROTO_IGMP(ch->flags);
- if (ch->upstream)
- ch->upstream->flags |= up_flags;
- else if (PIM_DEBUG_EVENTS)
- zlog_debug("%s:%pSG No Upstream found", __func__, sg);
+ ch->upstream->flags |= up_flags;
return ch;
}
@@ -637,8 +634,7 @@ static void ifjoin_to_noinfo(struct pim_ifchannel *ch)
pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO);
pim_forward_stop(ch);
- if (ch->upstream)
- PIM_UPSTREAM_FLAG_UNSET_SRC_PIM(ch->upstream->flags);
+ PIM_UPSTREAM_FLAG_UNSET_SRC_PIM(ch->upstream->flags);
PIM_IF_FLAG_UNSET_PROTO_PIM(ch->flags);
@@ -696,31 +692,29 @@ static void on_ifjoin_prune_pending_timer(struct thread *t)
* message on RP path upon prune timer expiry.
*/
ch->ifjoin_state = PIM_IFJOIN_PRUNE;
- if (ch->upstream) {
- struct pim_upstream *parent =
- ch->upstream->parent;
+ struct pim_upstream *parent =
+ ch->upstream->parent;
- pim_upstream_update_join_desired(pim_ifp->pim,
- ch->upstream);
+ pim_upstream_update_join_desired(pim_ifp->pim,
+ ch->upstream);
- pim_jp_agg_single_upstream_send(&parent->rpf,
- parent, true);
- /*
- * SGRpt prune pending expiry has to install
- * SG entry with empty olist to drop the SG
- * traffic incase no other intf exists.
- * On that scenario, SG entry wouldn't have
- * got installed until Prune pending timer
- * expired. So install now.
- */
- pim_channel_del_oif(
- ch->upstream->channel_oil, ifp,
- PIM_OIF_FLAG_PROTO_STAR, __func__);
- if (!ch->upstream->channel_oil->installed)
- pim_upstream_mroute_add(
- ch->upstream->channel_oil,
- __func__);
- }
+ pim_jp_agg_single_upstream_send(&parent->rpf,
+ parent, true);
+ /*
+ * SGRpt prune pending expiry has to install
+ * SG entry with empty olist to drop the SG
+ * traffic incase no other intf exists.
+ * On that scenario, SG entry wouldn't have
+ * got installed until Prune pending timer
+ * expired. So install now.
+ */
+ pim_channel_del_oif(
+ ch->upstream->channel_oil, ifp,
+ PIM_OIF_FLAG_PROTO_STAR, __func__);
+ if (!ch->upstream->channel_oil->installed)
+ pim_upstream_mroute_add(
+ ch->upstream->channel_oil,
+ __func__);
}
/* from here ch may have been deleted */
}