if (ch->upstream->channel_oil)
{
- pim_channel_del_oif (ch->upstream->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_PIM);
+ uint32_t mask = PIM_OIF_FLAG_PROTO_PIM;
+ if (ch->upstream->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
+ mask = PIM_OIF_FLAG_PROTO_IGMP;
+
+ 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.
}
}
-void pim_ifchannel_local_membership_add(struct interface *ifp,
- struct prefix_sg *sg)
+int
+pim_ifchannel_local_membership_add(struct interface *ifp,
+ struct prefix_sg *sg)
{
struct pim_ifchannel *ch;
struct pim_interface *pim_ifp;
/* PIM enabled on interface? */
pim_ifp = ifp->info;
if (!pim_ifp)
- return;
+ return 0;
if (!PIM_IF_TEST_PIM(pim_ifp->options))
- return;
+ return 0;
ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP);
if (!ch) {
- return;
+ return 0;
}
ifmembership_set(ch, PIM_IFMEMBERSHIP_INCLUDE);
}
}
}
+
+ return 1;
}
void pim_ifchannel_local_membership_del(struct interface *ifp,
struct prefix_sg *sg,
uint8_t source_flags,
uint16_t holdtime);
-void pim_ifchannel_local_membership_add(struct interface *ifp,
- struct prefix_sg *sg);
+int pim_ifchannel_local_membership_add(struct interface *ifp,
+ struct prefix_sg *sg);
void pim_ifchannel_local_membership_del(struct interface *ifp,
struct prefix_sg *sg);
Feed IGMPv3-gathered local membership information into PIM
per-interface (S,G) state.
*/
- pim_ifchannel_local_membership_add(group->group_igmp_sock->interface, &sg);
+ if (!pim_ifchannel_local_membership_add(group->group_igmp_sock->interface, &sg))
+ {
+ if (PIM_DEBUG_MROUTE)
+ zlog_warn ("%s: Failure to add local membership for %s",
+ __PRETTY_FUNCTION__, pim_str_sg_dump (&sg));
+ return;
+ }
IGMP_SOURCE_DO_FORWARDING(source->source_flags);
}
void pim_forward_start(struct pim_ifchannel *ch)
{
struct pim_upstream *up = ch->upstream;
+ uint32_t mask = PIM_OIF_FLAG_PROTO_PIM;
if (PIM_DEBUG_PIM_TRACE) {
char source_str[INET_ADDRSTRLEN];
}
}
- pim_channel_add_oif(up->channel_oil,
- ch->interface,
- PIM_OIF_FLAG_PROTO_PIM);
+ if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
+ mask = PIM_OIF_FLAG_PROTO_IGMP;
+
+ pim_channel_add_oif(up->channel_oil, ch->interface, mask);
}
void pim_forward_stop(struct pim_ifchannel *ch)