struct pim_upstream *up;
struct pim_rpf *rpg;
struct prefix_sg sg;
+ struct channel_oil *oil;
rpg = RP(msg->im_dst);
/*
__PRETTY_FUNCTION__, pim_str_sg_dump (&sg));
}
- up = pim_upstream_add (&sg, ifp);
- if (!up) {
+ oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
+ if (!oil) {
if (PIM_DEBUG_MROUTE) {
- zlog_debug("%s: Failure to add upstream information for %s",
+ zlog_debug("%s: Failure to add channel oil for %s",
__PRETTY_FUNCTION__,
pim_str_sg_dump (&sg));
}
return 0;
}
- pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
-
- up->channel_oil = pim_channel_oil_add(&sg,
- pim_ifp->mroute_vif_index);
- if (!up->channel_oil) {
+ up = pim_upstream_add (&sg, ifp);
+ if (!up) {
if (PIM_DEBUG_MROUTE) {
- zlog_debug("%s: Failure to add channel oil for %s",
+ zlog_debug("%s: Failure to add upstream information for %s",
__PRETTY_FUNCTION__,
pim_str_sg_dump (&sg));
}
return 0;
}
+
+ pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
+
+ up->channel_oil = oil;
up->channel_oil->cc.pktcnt++;
up->fhr = 1;
pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
struct pim_ifchannel *ch;
struct pim_upstream *up;
struct prefix_sg sg;
+ struct channel_oil *oil;
memset (&sg, 0, sizeof (struct prefix_sg));
sg.src = ip_hdr->ip_src;
return 0;
}
- up = pim_upstream_add (&sg, ifp);
-
- if (!up)
+ pim_ifp = ifp->info;
+ oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
+ if (!oil->installed)
+ pim_mroute_add (oil);
+ if (pim_if_connected_to_source (ifp, sg.src))
{
- if (PIM_DEBUG_MROUTE)
- zlog_debug ("%s: WRONGVIF%s unable to create upstream on interface",
- pim_str_sg_dump (&sg), ifp->name);
- return -2;
- }
+ up = pim_upstream_add (&sg, ifp);
- if (pim_if_connected_to_source (ifp, sg.src))
- up->fhr = 1;
+ if (!up)
+ {
+ if (PIM_DEBUG_MROUTE)
+ zlog_debug ("%s: WRONGVIF%s unable to create upstream on interface",
+ pim_str_sg_dump (&sg), ifp->name);
+ return -2;
+ }
+ up->fhr = 1;
- pim_ifp = ifp->info;
- pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
- up->channel_oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
- up->channel_oil->cc.pktcnt++;
- pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
- up->join_state = PIM_UPSTREAM_JOINED;
- pim_upstream_inherited_olist (up);
+ pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
+ up->channel_oil = oil;
+ up->channel_oil->cc.pktcnt++;
+ pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
+ up->join_state = PIM_UPSTREAM_JOINED;
+ pim_upstream_inherited_olist (up);
- // Send the packet to the RP
- pim_mroute_msg_wholepkt (fd, ifp, buf);
+ // Send the packet to the RP
+ pim_mroute_msg_wholepkt (fd, ifp, buf);
+ }
return 0;
}