diff options
author | Linus Lüssing <linus.luessing@web.de> | 2013-09-03 20:13:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-05 12:35:53 -0400 |
commit | 3c3769e63301fd92fcaf51870c371583dd0282ce (patch) | |
tree | bdb41fcb0cde61816896406a405d1385cd4d446e /net/bridge | |
parent | 8fad9c39f31f9ed7bf3526c43a4537b2fcf1a5d5 (diff) |
bridge: apply multicast snooping to IPv6 link-local, too
The multicast snooping code should have matured enough to be safely
applicable to IPv6 link-local multicast addresses (excluding the
link-local all nodes address, ff02::1), too.
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_mdb.c | 3 | ||||
-rw-r--r-- | net/bridge/br_multicast.c | 7 | ||||
-rw-r--r-- | net/bridge/br_private.h | 10 |
3 files changed, 6 insertions, 14 deletions
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index e4d5cd43b7fb..de818d95c476 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <net/netlink.h> | 9 | #include <net/netlink.h> |
10 | #if IS_ENABLED(CONFIG_IPV6) | 10 | #if IS_ENABLED(CONFIG_IPV6) |
11 | #include <net/ipv6.h> | 11 | #include <net/ipv6.h> |
12 | #include <net/addrconf.h> | ||
12 | #endif | 13 | #endif |
13 | 14 | ||
14 | #include "br_private.h" | 15 | #include "br_private.h" |
@@ -254,7 +255,7 @@ static bool is_valid_mdb_entry(struct br_mdb_entry *entry) | |||
254 | return false; | 255 | return false; |
255 | #if IS_ENABLED(CONFIG_IPV6) | 256 | #if IS_ENABLED(CONFIG_IPV6) |
256 | } else if (entry->addr.proto == htons(ETH_P_IPV6)) { | 257 | } else if (entry->addr.proto == htons(ETH_P_IPV6)) { |
257 | if (!ipv6_is_transient_multicast(&entry->addr.u.ip6)) | 258 | if (ipv6_addr_is_ll_all_nodes(&entry->addr.u.ip6)) |
258 | return false; | 259 | return false; |
259 | #endif | 260 | #endif |
260 | } else | 261 | } else |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 5388955b2a3c..23531471f16a 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/ipv6.h> | 29 | #include <net/ipv6.h> |
30 | #include <net/mld.h> | 30 | #include <net/mld.h> |
31 | #include <net/ip6_checksum.h> | 31 | #include <net/ip6_checksum.h> |
32 | #include <net/addrconf.h> | ||
32 | #endif | 33 | #endif |
33 | 34 | ||
34 | #include "br_private.h" | 35 | #include "br_private.h" |
@@ -723,7 +724,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br, | |||
723 | { | 724 | { |
724 | struct br_ip br_group; | 725 | struct br_ip br_group; |
725 | 726 | ||
726 | if (!ipv6_is_transient_multicast(group)) | 727 | if (ipv6_addr_is_ll_all_nodes(group)) |
727 | return 0; | 728 | return 0; |
728 | 729 | ||
729 | br_group.u.ip6 = *group; | 730 | br_group.u.ip6 = *group; |
@@ -1354,7 +1355,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br, | |||
1354 | { | 1355 | { |
1355 | struct br_ip br_group; | 1356 | struct br_ip br_group; |
1356 | 1357 | ||
1357 | if (!ipv6_is_transient_multicast(group)) | 1358 | if (ipv6_addr_is_ll_all_nodes(group)) |
1358 | return; | 1359 | return; |
1359 | 1360 | ||
1360 | br_group.u.ip6 = *group; | 1361 | br_group.u.ip6 = *group; |
@@ -1495,7 +1496,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, | |||
1495 | return 0; | 1496 | return 0; |
1496 | 1497 | ||
1497 | /* Prevent flooding this packet if there is no listener present */ | 1498 | /* Prevent flooding this packet if there is no listener present */ |
1498 | if (ipv6_is_transient_multicast(&ip6h->daddr)) | 1499 | if (!ipv6_addr_is_ll_all_nodes(&ip6h->daddr)) |
1499 | BR_INPUT_SKB_CB(skb)->mrouters_only = 1; | 1500 | BR_INPUT_SKB_CB(skb)->mrouters_only = 1; |
1500 | 1501 | ||
1501 | if (ip6h->nexthdr != IPPROTO_HOPOPTS || | 1502 | if (ip6h->nexthdr != IPPROTO_HOPOPTS || |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index d41283c57952..89b2949be02f 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -476,16 +476,6 @@ extern void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port, | |||
476 | #define mlock_dereference(X, br) \ | 476 | #define mlock_dereference(X, br) \ |
477 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) | 477 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) |
478 | 478 | ||
479 | #if IS_ENABLED(CONFIG_IPV6) | ||
480 | #include <net/addrconf.h> | ||
481 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) | ||
482 | { | ||
483 | if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) | ||
484 | return 1; | ||
485 | return 0; | ||
486 | } | ||
487 | #endif | ||
488 | |||
489 | static inline bool br_multicast_is_router(struct net_bridge *br) | 479 | static inline bool br_multicast_is_router(struct net_bridge *br) |
490 | { | 480 | { |
491 | return br->multicast_router == 2 || | 481 | return br->multicast_router == 2 || |