static void source_channel_oil_detach(struct igmp_source *source)
{
if (source->source_channel_oil) {
- pim_channel_oil_del(source->source_channel_oil);
+ pim_channel_oil_del(source->source_channel_oil,
+ __PRETTY_FUNCTION__);
source->source_channel_oil = NULL;
}
}
* and causing us to consider them.
*/
c_oil = pim_channel_oil_add(pim_ifp->pim, &sg,
- pim_ifp->mroute_vif_index);
+ pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
pim_mroute_add(c_oil, __PRETTY_FUNCTION__);
return 0;
if (!up->channel_oil)
up->channel_oil = pim_channel_oil_add(
pim_ifp->pim, &sg,
- pim_ifp->mroute_vif_index);
+ pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
pim_upstream_inherited_olist(pim_ifp->pim, up);
if (!up->channel_oil->installed)
pim_mroute_add(up->channel_oil,
}
pim_ifp = ifp->info;
- oil = pim_channel_oil_add(pim_ifp->pim, &sg, pim_ifp->mroute_vif_index);
+ oil = pim_channel_oil_add(pim_ifp->pim, &sg, pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
if (!oil->installed)
pim_mroute_add(oil, __PRETTY_FUNCTION__);
if (pim_if_connected_to_source(ifp, sg.src)) {
struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
struct prefix_sg *sg,
- int input_vif_index)
+ int input_vif_index, const char *name)
{
struct channel_oil *c_oil;
struct interface *ifp;
if (c_oil) {
if (c_oil->oil.mfcc_parent != input_vif_index) {
c_oil->oil_inherited_rescan = 1;
- if (PIM_DEBUG_MROUTE)
+ if (PIM_DEBUG_MROUTE_DETAIL)
zlog_debug(
- "%s: Existing channel oil %s points to %d, modifying to point at %d",
- __PRETTY_FUNCTION__,
- pim_str_sg_dump(sg),
+ "%s: Existing channel oil %pSG4 points to %d, modifying to point at %d",
+ __PRETTY_FUNCTION__, sg,
c_oil->oil.mfcc_parent,
input_vif_index);
}
c_oil->oil.mfcc_parent = input_vif_index;
++c_oil->oil_ref_count;
- c_oil->up = pim_upstream_find(
- pim, sg); // channel might be present prior to upstream
+ /* channel might be present prior to upstream */
+ c_oil->up = pim_upstream_find(pim, sg);
+
+ if (PIM_DEBUG_MROUTE)
+ zlog_debug(
+ "%s(%s): Existing oil for %pSG4 Ref Count: %d (Post Increment)",
+ __PRETTY_FUNCTION__, name, sg,
+ c_oil->oil_ref_count);
return c_oil;
}
if (!ifp) {
/* warning only */
zlog_warn(
- "%s: (S,G)=%s could not find input interface for input_vif_index=%d",
- __PRETTY_FUNCTION__, pim_str_sg_dump(sg),
- input_vif_index);
+ "%s:%s (S,G)=%pSG4 could not find input interface for input_vif_index=%d",
+ __PRETTY_FUNCTION__, name, sg, input_vif_index);
}
}
listnode_add_sort(pim->channel_oil_list, c_oil);
+ if (PIM_DEBUG_MROUTE)
+ zlog_debug(
+ "%s(%s): New oil for %pSG4 vif_index: %d Ref Count: 1 (Post Increment)",
+ __PRETTY_FUNCTION__, name, sg, input_vif_index);
return c_oil;
}
-void pim_channel_oil_del(struct channel_oil *c_oil)
+void pim_channel_oil_del(struct channel_oil *c_oil, const char *name)
{
+ if (PIM_DEBUG_MROUTE) {
+ struct prefix_sg sg = {.src = c_oil->oil.mfcc_mcastgrp,
+ .grp = c_oil->oil.mfcc_origin};
+
+ zlog_debug(
+ "%s(%s): Del oil for %pSG4, Ref Count: %d (Predecrement)",
+ __PRETTY_FUNCTION__, name, &sg, c_oil->oil_ref_count);
+ }
--c_oil->oil_ref_count;
if (c_oil->oil_ref_count < 1) {
struct prefix_sg *sg);
struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
struct prefix_sg *sg,
- int input_vif_index);
-void pim_channel_oil_del(struct channel_oil *c_oil);
+ int input_vif_index, const char *name);
+void pim_channel_oil_del(struct channel_oil *c_oil, const char *name);
int pim_channel_add_oif(struct channel_oil *c_oil, struct interface *oif,
uint32_t proto_mask);
but upstream would not keep reference of it
*/
up->channel_oil->up = NULL;
- pim_channel_oil_del(up->channel_oil);
+ pim_channel_oil_del(up->channel_oil, __PRETTY_FUNCTION__);
up->channel_oil = NULL;
}
}
pim_upstream_fill_static_iif(up, incoming);
pim_ifp = up->rpf.source_nexthop.interface->info;
assert(pim_ifp);
- up->channel_oil = pim_channel_oil_add(pim,
- &up->sg, pim_ifp->mroute_vif_index);
+ up->channel_oil = pim_channel_oil_add(pim, &up->sg,
+ pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
} else if (up->upstream_addr.s_addr == INADDR_ANY) {
/* Create a dummmy channel oil with incoming ineterface MAXVIFS,
* since RP is not configured
*/
- up->channel_oil = pim_channel_oil_add(pim, &up->sg, MAXVIFS);
+ up->channel_oil = pim_channel_oil_add(pim, &up->sg, MAXVIFS,
+ __PRETTY_FUNCTION__);
} else {
rpf_result = pim_rpf_update(pim, up, NULL);
* MAXVIFS, since RP is not reachable
*/
up->channel_oil = pim_channel_oil_add(
- pim, &up->sg, MAXVIFS);
+ pim, &up->sg, MAXVIFS, __PRETTY_FUNCTION__);
}
if (up->rpf.source_nexthop.interface) {
pim_ifp = up->rpf.source_nexthop.interface->info;
if (pim_ifp)
- up->channel_oil = pim_channel_oil_add(pim,
- &up->sg, pim_ifp->mroute_vif_index);
+ up->channel_oil = pim_channel_oil_add(
+ pim, &up->sg, pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
}
}
__PRETTY_FUNCTION__, up->sg_str);
}
if (pim_ifp && !up->channel_oil)
- up->channel_oil = pim_channel_oil_add(
- pim, &up->sg, pim_ifp->mroute_vif_index);
+ up->channel_oil = pim_channel_oil_add(pim, &up->sg,
+ pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
FOR_ALL_INTERFACES (pim->vrf, ifp) {
if (!ifp->info)
if (!pim_rp_set_upstream_addr(pim, &vif_source,
source->source_addr, sg.grp)) {
/*Create a dummy channel oil */
- source->source_channel_oil =
- pim_channel_oil_add(pim, &sg, MAXVIFS);
+ source->source_channel_oil = pim_channel_oil_add(
+ pim, &sg, MAXVIFS, __PRETTY_FUNCTION__);
if (!source->source_channel_oil) {
if (PIM_DEBUG_IGMP_TRACE) {
source_str);
}
source->source_channel_oil =
- pim_channel_oil_add(pim, &sg, MAXVIFS);
+ pim_channel_oil_add(
+ pim, &sg, MAXVIFS,
+ __PRETTY_FUNCTION__);
}
else {
}
source->source_channel_oil =
- pim_channel_oil_add(pim, &sg,
- input_iface_vif_index);
+ pim_channel_oil_add(
+ pim, &sg, input_iface_vif_index,
+ __PRETTY_FUNCTION__);
if (!source->source_channel_oil) {
if (PIM_DEBUG_IGMP_TRACE) {
zlog_debug(
__FILE__, __PRETTY_FUNCTION__,
source_str);
}
- up->channel_oil = pim_channel_oil_add(pim, &up->sg,
- MAXVIFS);
+ up->channel_oil = pim_channel_oil_add(
+ pim, &up->sg, MAXVIFS, __PRETTY_FUNCTION__);
}
else {
- up->channel_oil = pim_channel_oil_add(pim, &up->sg,
- input_iface_vif_index);
+ up->channel_oil = pim_channel_oil_add(
+ pim, &up->sg, input_iface_vif_index,
+ __PRETTY_FUNCTION__);
if (!up->channel_oil) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
input_iface_vif_index, up->sg_str);
}
- up->channel_oil = pim_channel_oil_add(pim, &up->sg,
- input_iface_vif_index);
+ up->channel_oil =
+ pim_channel_oil_add(pim, &up->sg, input_iface_vif_index,
+ __PRETTY_FUNCTION__);
if (!up->channel_oil) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(