up->join_state = PIM_UPSTREAM_NOTJOINED;
up->reg_state = PIM_REG_NOINFO;
up->state_transition = pim_time_monotonic_sec();
- up->channel_oil = NULL;
+ up->channel_oil =
+ pim_channel_oil_add(pim, &up->sg, MAXVIFS, __PRETTY_FUNCTION__);
up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;
up->rpf.source_nexthop.interface = 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,
- __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,
- __PRETTY_FUNCTION__);
-
- } else {
+ pim_channel_oil_change_iif(pim, up->channel_oil,
+ pim_ifp->mroute_vif_index,
+ __PRETTY_FUNCTION__);
+ } else if (up->upstream_addr.s_addr != INADDR_ANY) {
rpf_result = pim_rpf_update(pim, up, NULL);
if (rpf_result == PIM_RPF_FAILURE) {
if (PIM_DEBUG_TRACE)
zlog_debug(
"%s: Attempting to create upstream(%s), Unable to RPF for source",
__PRETTY_FUNCTION__, up->sg_str);
- /* Create a dummmy channel oil with incoming ineterface
- * MAXVIFS, since RP is not reachable
- */
- up->channel_oil = pim_channel_oil_add(
- 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,
+ pim_channel_oil_change_iif(
+ pim, up->channel_oil,
+ pim_ifp->mroute_vif_index,
__PRETTY_FUNCTION__);
- else {
- /*
- * Yeah this should not happen
- * but let's be sure that we are not
- * doing something stupid, all paths
- * through upstream creation will
- * create a channel oil
- */
- up->channel_oil = pim_channel_oil_add(
- pim, &up->sg, MAXVIFS,
- __PRETTY_FUNCTION__);
- }
}
}
struct pim_upstream *up)
{
struct interface *ifp;
- struct pim_interface *pim_ifp = NULL;
struct pim_ifchannel *ch, *starch;
struct pim_upstream *starup = up->parent;
int output_intf = 0;
- if (up->rpf.source_nexthop.interface)
- pim_ifp = up->rpf.source_nexthop.interface->info;
- else {
+ if (!up->rpf.source_nexthop.interface)
if (PIM_DEBUG_TRACE)
zlog_debug("%s: up %s RPF is not present",
__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,
- __PRETTY_FUNCTION__);
FOR_ALL_INTERFACES (pim->vrf, ifp) {
if (!ifp->info)
__FILE__, __PRETTY_FUNCTION__,
source_str);
}
- up->channel_oil = pim_channel_oil_add(
- pim, &up->sg, MAXVIFS, __PRETTY_FUNCTION__);
+ pim_channel_oil_change_iif(pim, up->channel_oil,
+ MAXVIFS,
+ __PRETTY_FUNCTION__);
}
else
- up->channel_oil = pim_channel_oil_add(
- pim, &up->sg, input_iface_vif_index,
- __PRETTY_FUNCTION__);
+ pim_channel_oil_change_iif(pim, up->channel_oil,
+ input_iface_vif_index,
+ __PRETTY_FUNCTION__);
if (PIM_DEBUG_TRACE) {
struct interface *in_intf = pim_if_find_by_vif_index(
in_intf ? in_intf->name : "Unknown",
input_iface_vif_index, up->sg_str);
}
-
- up->channel_oil =
- pim_channel_oil_add(pim, &up->sg, input_iface_vif_index,
- __PRETTY_FUNCTION__);
}
if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)