Skip to content

Commit

Permalink
bridge: prevent flooding IPv6 packets that do not have a listener
Browse files Browse the repository at this point in the history
Currently if there is no listener for a certain group then IPv6 packets
for that group are flooded on all ports, even though there might be no
host and router interested in it on a port.

With this commit they are only forwarded to ports with a multicast
router.

Just like commit bd4265f ("bridge: Only flood unregistered groups
to routers") did for IPv4, let's do the same for IPv6 with the same
reasoning.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Linus Lüssing authored and David S. Miller committed Sep 5, 2013
1 parent f212781 commit 8fad9c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,14 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
* - MLD has always Router Alert hop-by-hop option
* - But we do not support jumbrograms.
*/
if (ip6h->version != 6 ||
ip6h->nexthdr != IPPROTO_HOPOPTS ||
if (ip6h->version != 6)
return 0;

/* Prevent flooding this packet if there is no listener present */
if (ipv6_is_transient_multicast(&ip6h->daddr))
BR_INPUT_SKB_CB(skb)->mrouters_only = 1;

if (ip6h->nexthdr != IPPROTO_HOPOPTS ||
ip6h->payload_len == 0)
return 0;

Expand Down

0 comments on commit 8fad9c3

Please sign in to comment.