Skip to content

Commit

Permalink
bridge: Allow mcast snooping for transient link local addresses too
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Lüssing authored and David S. Miller committed Feb 22, 2011
1 parent 5ced133 commit e4de9f9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static inline int ipv6_is_local_multicast(const struct in6_addr *addr)
static inline int ipv6_is_transient_multicast(const struct in6_addr *addr)
{
if (ipv6_addr_is_multicast(addr) &&
IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL)
if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr))
return 1;
return 0;
}
Expand Down Expand Up @@ -780,7 +779,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br,
{
struct br_ip br_group;

if (ipv6_is_local_multicast(group))
if (!ipv6_is_transient_multicast(group))
return 0;

ipv6_addr_copy(&br_group.u.ip6, group);
Expand Down Expand Up @@ -1341,7 +1340,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
{
struct br_ip br_group;

if (ipv6_is_local_multicast(group))
if (!ipv6_is_transient_multicast(group))
return;

ipv6_addr_copy(&br_group.u.ip6, group);
Expand Down

0 comments on commit e4de9f9

Please sign in to comment.