summaryrefslogtreecommitdiffstats
path: root/pimd/pim_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-07-09 15:22:56 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-07-10 00:04:00 +0200
commit75c61a18758544c06166bd56b6ce12ce0886c7b2 (patch)
tree600ddbb9a0a0b0b5964ce99f338ec2a55f088362 /pimd/pim_zebra.c
parentMerge pull request #2636 from ppmathis/cleanup/bgpd (diff)
downloadfrr-75c61a18758544c06166bd56b6ce12ce0886c7b2.tar.xz
frr-75c61a18758544c06166bd56b6ce12ce0886c7b2.zip
pimd: Do not create upstream state when not DR for igmp request
When we receive a IGMP report on an interface, do not create upstream state for that request, unless we are the DR for the incoming interface. This will prevent a interface on a LAN segment from causing traffic to flow to itself. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_zebra.c')
-rw-r--r--pimd/pim_zebra.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index a58dfcdd5..eddb4c776 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -868,6 +868,7 @@ void igmp_source_forward_reevaluate_all(struct pim_instance *pim)
void igmp_source_forward_start(struct pim_instance *pim,
struct igmp_source *source)
{
+ struct pim_interface *pim_oif;
struct igmp_group *group;
struct prefix_sg sg;
int result;
@@ -893,10 +894,20 @@ void igmp_source_forward_start(struct pim_instance *pim,
}
group = source->source_group;
+ pim_oif = group->group_igmp_sock->interface->info;
+ if (!pim_oif) {
+ if (PIM_DEBUG_IGMP_TRACE) {
+ zlog_debug(
+ "%s: multicast not enabled on oif=%s ?",
+ __PRETTY_FUNCTION__,
+ source->source_group->group_igmp_sock
+ ->interface->name);
+ }
+ return;
+ }
if (!source->source_channel_oil) {
struct in_addr vif_source;
- struct pim_interface *pim_oif;
struct prefix nht_p, src, grp;
struct pim_nexthop_cache out_pnc;
struct pim_nexthop nexthop;
@@ -983,19 +994,6 @@ void igmp_source_forward_start(struct pim_instance *pim,
source and receiver attached to the same interface. See TODO
T22.
*/
- pim_oif =
- source->source_group->group_igmp_sock->interface->info;
- if (!pim_oif) {
- if (PIM_DEBUG_IGMP_TRACE) {
- zlog_debug(
- "%s: multicast not enabled on oif=%s ?",
- __PRETTY_FUNCTION__,
- source->source_group->group_igmp_sock
- ->interface->name);
- }
- return;
- }
-
if (input_iface_vif_index == pim_oif->mroute_vif_index) {
/* ignore request for looped MFC entry */
if (PIM_DEBUG_IGMP_TRACE) {
@@ -1036,12 +1034,15 @@ void igmp_source_forward_start(struct pim_instance *pim,
return;
}
+ if (!(PIM_I_am_DR(pim_oif)))
+ return;
+
/*
Feed IGMPv3-gathered local membership information into PIM
per-interface (S,G) state.
*/
if (!pim_ifchannel_local_membership_add(
- group->group_igmp_sock->interface, &sg)) {
+ 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));