Skip to content

Commit bd4265f

Browse files
herbertxdavem330
authored andcommitted
bridge: Only flood unregistered groups to routers
The bridge currently floods packets to groups that we have never seen before to all ports. This is not required by RFC4541 and in fact it is not desirable in environment where traffic to unregistered group is always present. This patch changes the behaviour so that we only send traffic to unregistered groups to ports marked as routers. The user can always force flooding behaviour to any given port by marking it as a router. Note that this change does not apply to traffic to 224.0.0.X as traffic to those groups must always be flooded to all ports. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b997d79 commit bd4265f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/bridge/br_multicast.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,8 +1379,11 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
13791379
if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
13801380
return -EINVAL;
13811381

1382-
if (iph->protocol != IPPROTO_IGMP)
1382+
if (iph->protocol != IPPROTO_IGMP) {
1383+
if ((iph->daddr & IGMP_LOCAL_GROUP_MASK) != IGMP_LOCAL_GROUP)
1384+
BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
13831385
return 0;
1386+
}
13841387

13851388
len = ntohs(iph->tot_len);
13861389
if (skb->len < len || len < ip_hdrlen(skb))

0 commit comments

Comments
 (0)