From 2830b0186384ff53ed33186276936739f2e079cb Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 30 Mar 2017 10:50:04 -0400 Subject: [PATCH] pimd: Fix crash when failure to create upstream When we have a *,G mroute that starts receiving any particular S,G, we will get wholepkt callbacks due to the pimreg in the OIL for the *,G. So we need to do SPT switchover, but this can fail if we do not have a path to the S( but we do to the RP!). In this case fail gracefully. Ticket: CM-15621 Signed-off-by: Donald Sharp --- pimd/pim_mroute.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index cfbd07ede0..1df4c033bc 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -208,6 +208,13 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const char *buf) if (up && PIM_UPSTREAM_FLAG_TEST_SRC_IGMP(up->flags)) { up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_LHR, __PRETTY_FUNCTION__); + if (!up) + { + if (PIM_DEBUG_MROUTE) + zlog_debug ("%s: Unable to create upstream information for %s", + __PRETTY_FUNCTION__, pim_str_sg_dump (&sg)); + return 0; + } pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time); pim_upstream_inherited_olist (up); pim_upstream_switch(up, PIM_UPSTREAM_JOINED); -- 2.39.5