aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@web.de>2011-02-15 08:19:21 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-22 13:07:28 -0500
commite4de9f9e8333fbbae951c6e068f501f955123cf0 (patch)
treeb3b09d3d6510f57724c599246f2bbe08451f8165 /net/bridge
parent5ced1339612d1fa095459bd481f1d1f64f76f859 (diff)
bridge: Allow mcast snooping for transient link local addresses too
Currently the multicast bridge snooping support is not active for link local multicast. I assume this has been done to leave important multicast data untouched, like IPv6 Neighborhood Discovery. In larger, bridged, local networks it could however be desirable to optimize for instance local multicast audio/video streaming too. With the transient flag in IPv6 multicast addresses we have an easy way to optimize such multimedia traffic without tempering with the high priority multicast data from well-known addresses. This patch alters the multicast bridge snooping for IPv6, to take effect for transient multicast addresses instead of non-link-local addresses. 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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 9ce2af187709..1207a5a0688a 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -37,10 +37,9 @@
37 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) 37 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))
38 38
39#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 39#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
40static inline int ipv6_is_local_multicast(const struct in6_addr *addr) 40static inline int ipv6_is_transient_multicast(const struct in6_addr *addr)
41{ 41{
42 if (ipv6_addr_is_multicast(addr) && 42 if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr))
43 IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL)
44 return 1; 43 return 1;
45 return 0; 44 return 0;
46} 45}
@@ -780,7 +779,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br,
780{ 779{
781 struct br_ip br_group; 780 struct br_ip br_group;
782 781
783 if (ipv6_is_local_multicast(group)) 782 if (!ipv6_is_transient_multicast(group))
784 return 0; 783 return 0;
785 784
786 ipv6_addr_copy(&br_group.u.ip6, group); 785 ipv6_addr_copy(&br_group.u.ip6, group);
@@ -1341,7 +1340,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
1341{ 1340{
1342 struct br_ip br_group; 1341 struct br_ip br_group;
1343 1342
1344 if (ipv6_is_local_multicast(group)) 1343 if (!ipv6_is_transient_multicast(group))
1345 return; 1344 return;
1346 1345
1347 ipv6_addr_copy(&br_group.u.ip6, group); 1346 ipv6_addr_copy(&br_group.u.ip6, group);