diff options
author | Linus Lüssing <linus.luessing@web.de> | 2013-09-03 20:13:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-05 12:35:41 -0400 |
commit | 8fad9c39f31f9ed7bf3526c43a4537b2fcf1a5d5 (patch) | |
tree | 885aa1b9b1ace31ff2550cc40aaa23106a6574ad /net/bridge | |
parent | f21278108204ab244cd534a0d45c174ecc559267 (diff) |
bridge: prevent flooding IPv6 packets that do not have a listener
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 bd4265fe36 ("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>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_multicast.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 4accd0de6e8e..5388955b2a3c 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1491,8 +1491,14 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, | |||
1491 | * - MLD has always Router Alert hop-by-hop option | 1491 | * - MLD has always Router Alert hop-by-hop option |
1492 | * - But we do not support jumbrograms. | 1492 | * - But we do not support jumbrograms. |
1493 | */ | 1493 | */ |
1494 | if (ip6h->version != 6 || | 1494 | if (ip6h->version != 6) |
1495 | ip6h->nexthdr != IPPROTO_HOPOPTS || | 1495 | return 0; |
1496 | |||
1497 | /* Prevent flooding this packet if there is no listener present */ | ||
1498 | if (ipv6_is_transient_multicast(&ip6h->daddr)) | ||
1499 | BR_INPUT_SKB_CB(skb)->mrouters_only = 1; | ||
1500 | |||
1501 | if (ip6h->nexthdr != IPPROTO_HOPOPTS || | ||
1496 | ip6h->payload_len == 0) | 1502 | ip6h->payload_len == 0) |
1497 | return 0; | 1503 | return 0; |
1498 | 1504 | ||