summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_ifchannel.c19
-rw-r--r--pimd/pim_ifchannel.h4
-rw-r--r--pimd/pim_zebra.c16
3 files changed, 27 insertions, 12 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 8d2de3c878..7056ade501 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -142,7 +142,11 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch)
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.
@@ -929,8 +933,9 @@ void pim_ifchannel_prune(struct interface *ifp,
}
}
-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;
@@ -938,13 +943,13 @@ void pim_ifchannel_local_membership_add(struct interface *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);
@@ -969,6 +974,8 @@ void pim_ifchannel_local_membership_add(struct interface *ifp,
}
}
}
+
+ return 1;
}
void pim_ifchannel_local_membership_del(struct interface *ifp,
diff --git a/pimd/pim_ifchannel.h b/pimd/pim_ifchannel.h
index bfe632135c..a3dc0e9d83 100644
--- a/pimd/pim_ifchannel.h
+++ b/pimd/pim_ifchannel.h
@@ -130,8 +130,8 @@ void pim_ifchannel_prune(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);
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index aa09819fbe..1bb4852c6b 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -1097,7 +1097,13 @@ void igmp_source_forward_start(struct igmp_source *source)
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);
}
@@ -1167,6 +1173,7 @@ void igmp_source_forward_stop(struct igmp_source *source)
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];
@@ -1206,9 +1213,10 @@ void pim_forward_start(struct pim_ifchannel *ch)
}
}
- 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)