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?
* Nuke from on high too.
pim_ifchannel_remove_children(ch);
if (ch->sources)
- list_delete_and_null(&ch->sources);
+ list_delete(&ch->sources);
listnode_delete(ch->upstream->ifchannels, ch);
ifchannel list is empty before deleting upstream_del
ref count will take care of it.
*/
- pim_upstream_del(pim_ifp->pim, ch->upstream, __PRETTY_FUNCTION__);
+ if (ch->upstream->ref_count > 0)
+ pim_upstream_del(pim_ifp->pim, ch->upstream,
+ __PRETTY_FUNCTION__);
+
+ else
+ zlog_warn("%s: Avoiding deletion of upstream with ref_count %d "
+ "from ifchannel(%s): %s", __PRETTY_FUNCTION__,
+ ch->upstream->ref_count, ch->interface->name,
+ ch->sg_str);
+
ch->upstream = NULL;
THREAD_OFF(ch->t_ifjoin_expiry_timer);
up = pim_upstream_add(pim_ifp->pim, sg, NULL, up_flags,
__PRETTY_FUNCTION__, ch);
- if (!up) {
- zlog_err(
- "%s: could not attach upstream (S,G)=%s on interface %s",
- __PRETTY_FUNCTION__, pim_str_sg_dump(sg), ifp->name);
-
- if (ch->parent)
- listnode_delete(ch->parent->sources, ch);
-
- pim_ifchannel_remove_children(ch);
- if (ch->sources)
- list_delete_and_null(&ch->sources);
-
- THREAD_OFF(ch->t_ifjoin_expiry_timer);
- THREAD_OFF(ch->t_ifjoin_prune_pending_timer);
- THREAD_OFF(ch->t_ifassert_timer);
-
- RB_REMOVE(pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch);
- XFREE(MTYPE_PIM_IFCHANNEL, ch);
- return NULL;
- }
ch->upstream = up;
listnode_add_sort(up->ifchannels, ch);
/* PIM enabled on interface? */
pim_ifp = ifp->info;
- if (!pim_ifp)
+ if (!pim_ifp) {
+ if (PIM_DEBUG_EVENTS)
+ zlog_debug("%s:%s Expected pim interface setup for %s",
+ __PRETTY_FUNCTION__,
+ pim_str_sg_dump(sg), ifp->name);
return 0;
- if (!PIM_IF_TEST_PIM(pim_ifp->options))
+ }
+
+ if (!PIM_IF_TEST_PIM(pim_ifp->options)) {
+ if (PIM_DEBUG_EVENTS)
+ zlog_debug("%s:%s PIM is not configured on this interface %s",
+ __PRETTY_FUNCTION__,
+ pim_str_sg_dump(sg), ifp->name);
return 0;
+ }
pim = pim_ifp->pim;
ch = pim_ifchannel_add(ifp, sg, 0, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP);
if (!ch) {
+ if (PIM_DEBUG_EVENTS)
+ zlog_debug("%s:%s Unable to add ifchannel",
+ __PRETTY_FUNCTION__,
+ pim_str_sg_dump(sg));
return 0;
}
struct channel_oil *c_oil = child->channel_oil;
struct pim_ifchannel *chchannel =
pim_ifchannel_find(ifp, &child->sg);
- struct pim_interface *pim_ifp = ifp->info;
+
+ pim_ifp = ifp->info;
if (PIM_DEBUG_EVENTS)
zlog_debug("%s %s: Prune(S,G)=%s(%s) from %s",