diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index f3c3e282c6..f4fe609605 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -145,6 +145,9 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) if (ch->upstream->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP) mask = PIM_OIF_FLAG_PROTO_IGMP; + /* SGRpt entry could have empty oil */ + if (ch->upstream->channel_oil) + pim_channel_del_oif (ch->upstream->channel_oil, ch->interface, mask); pim_channel_del_oif (ch->upstream->channel_oil, ch->interface, mask); /* * Do we have any S,G's that are inheriting? @@ -610,6 +613,7 @@ static int on_ifjoin_prune_pending_timer(struct thread *t) pim_ifp = ifp->info; send_prune_echo = (listcount(pim_ifp->pim_neighbor_list) > 1); + //ch->ifjoin_state transition to NOINFO ifjoin_to_noinfo(ch); /* from here ch may have been deleted */ @@ -1093,8 +1097,7 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, if (!chchannel && c_oil && c_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index]) pim_channel_del_oif (c_oil, ifp, PIM_OIF_FLAG_PROTO_STAR); - if (c_oil->oil_size == 0) - pim_upstream_del (child, __PRETTY_FUNCTION__); + /* Child node removal/ref count-- will happen as part of parent' delete_no_info */ } } delete_on_noinfo(orig); @@ -1288,7 +1291,7 @@ pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t if (up) { if (PIM_DEBUG_TRACE) - zlog_debug ("%s: add inherit oif to up %s ", __PRETTY_FUNCTION__, up->sg_str); + zlog_debug ("%s: clearing SGRpt flag, add inherit oif to up %s ", __PRETTY_FUNCTION__, up->sg_str); pim_channel_add_oif (up->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_STAR); } } diff --git a/pimd/pim_join.c b/pimd/pim_join.c index a9ca349102..828781a467 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -374,7 +374,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups) { struct pim_jp_agg_group *group; - struct pim_interface *pim_ifp; + struct pim_interface *pim_ifp = NULL; struct pim_jp_groups *grp = NULL; struct pim_jp *msg; struct listnode *node, *nnode; @@ -395,12 +395,13 @@ int pim_joinprune_send(struct pim_rpf *rpf, return -1; } - if (!pim_ifp) { - zlog_warn("%s: multicast not enabled on interface %s", + if (!pim_ifp) + { + zlog_warn ("%s: multicast not enabled on interface %s", __PRETTY_FUNCTION__, rpf->source_nexthop.interface->name); - return -1; - } + return -1; + } if (PIM_INADDR_IS_ANY(rpf->rpf_addr.u.prefix4)) { diff --git a/pimd/pim_jp_agg.c b/pimd/pim_jp_agg.c index bbc51bd91c..46c6cbc690 100644 --- a/pimd/pim_jp_agg.c +++ b/pimd/pim_jp_agg.c @@ -348,7 +348,7 @@ pim_jp_agg_single_upstream_send (struct pim_rpf *rpf, static bool first = true; /* skip JP upstream messages if source is directly connected */ - if (!rpf->source_nexthop.interface || + if (!up || !rpf->source_nexthop.interface || pim_if_connected_to_source (rpf->source_nexthop.interface, up->sg.src)) return; diff --git a/pimd/pim_msg.c b/pimd/pim_msg.c index e19893f5da..a9e0130905 100644 --- a/pimd/pim_msg.c +++ b/pimd/pim_msg.c @@ -195,7 +195,9 @@ pim_msg_build_jp_groups (struct pim_jp_groups *grp, struct pim_jp_agg_group *sgs struct pim_rpf *rpf = pim_rp_g (source->up->sg.grp); bits = PIM_ENCODE_SPARSE_BIT | PIM_ENCODE_WC_BIT | PIM_ENCODE_RPT_BIT; stosend = rpf->rpf_addr.u.prefix4; - up = source->up; + /* Only Send SGRpt in case of *,G Join */ + if (source->is_join) + up = source->up; } else { diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 062ae6e808..6c4504d9b0 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -741,7 +741,7 @@ pim_rp_g (struct in_addr group) char buf1[PREFIX2STR_BUFFER]; prefix2str (&nht_p, buf, sizeof (buf)); prefix2str (&rp_info->group, buf1, sizeof (buf1)); - zlog_debug ("%s: NHT Register RP addr %s grp %s with Zebra ", + zlog_debug ("%s: NHT Register RP addr %s grp %s with Zebra", __PRETTY_FUNCTION__, buf, buf1); } memset (&pnc, 0, sizeof (struct pim_nexthop_cache)); @@ -759,7 +759,7 @@ pim_rp_g (struct in_addr group) char buf1[PREFIX2STR_BUFFER]; prefix2str (&nht_p, buf, sizeof (buf)); prefix2str (&g, buf1, sizeof (buf1)); - zlog_debug ("%s: Nexthop cache not found for RP %s grp %s register with Zebra NHT", + zlog_debug ("%s: Nexthop cache not found for RP %s grp %s register with Zebra", __PRETTY_FUNCTION__, buf, buf1); } pim_rpf_set_refresh_time (); diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index f454ac59c1..f46ebfb979 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -240,8 +240,7 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct pim_rpf *old, if (pim_ecmp_nexthop_lookup (&rpf->source_nexthop, up->upstream_addr, &src, &grp, !PIM_UPSTREAM_FLAG_TEST_FHR (up->flags) && - !PIM_UPSTREAM_FLAG_TEST_SRC_IGMP (up-> - flags))) + !PIM_UPSTREAM_FLAG_TEST_SRC_IGMP (up->flags))) { return PIM_RPF_FAILURE; } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 2afcd6aeea..dd6eab9cfe 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -216,6 +216,7 @@ pim_upstream_del(struct pim_upstream *up, const char *name) up->sources = NULL; list_delete (up->ifchannels); + up->ifchannels = NULL; /* notice that listnode_delete() can't be moved @@ -243,7 +244,7 @@ pim_upstream_del(struct pim_upstream *up, const char *name) { char buf[PREFIX2STR_BUFFER]; prefix2str (&nht_p, buf, sizeof (buf)); - zlog_debug ("%s: Deregister upstream %s addr %s with Zebra", + zlog_debug ("%s: Deregister upstream %s addr %s with Zebra NHT", __PRETTY_FUNCTION__, up->sg_str, buf); } pim_delete_tracked_nexthop (&nht_p, up, NULL); @@ -1017,14 +1018,17 @@ static void pim_upstream_update_assert_tracking_desired(struct pim_upstream *up) struct pim_ifchannel *ch; /* scan per-interface (S,G) state */ - for (ALL_LIST_ELEMENTS(up->ifchannels, chnode, chnextnode, ch)) { - pim_ifp = ch->interface->info; - if (!pim_ifp) - continue; + for (ALL_LIST_ELEMENTS(up->ifchannels, chnode, chnextnode, ch)) + { + if (!ch->interface) + continue; + pim_ifp = ch->interface->info; + if (!pim_ifp) + continue; - pim_ifchannel_update_assert_tracking_desired(ch); + pim_ifchannel_update_assert_tracking_desired(ch); - } /* scan iface channel list */ + } /* scan iface channel list */ } /* When kat is stopped CouldRegister goes to false so we need to