diff options
author | Octavian Purdila <opurdila@ixiacom.com> | 2010-01-06 23:37:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-06 23:37:01 -0500 |
commit | 7ad6848c7e81a603605fad3f3575841aab004eea (patch) | |
tree | c95cc3473a2c47d6dedbbe5bc1a298546fc4127f /include/net/ip.h | |
parent | 58933c643f86651decc4818cf680f9ec3b0460d2 (diff) |
ip: fix mc_loop checks for tunnels with multicast outer addresses
When we have L3 tunnels with different inner/outer families
(i.e. IPV4/IPV6) which use a multicast address as the outer tunnel
destination address, multicast packets will be loopbacked back to the
sending socket even if IP*_MULTICAST_LOOP is set to disabled.
The mc_loop flag is present in the family specific part of the socket
(e.g. the IPv4 or IPv4 specific part). setsockopt sets the inner
family mc_loop flag. When the packet is pushed through the L3 tunnel
it will eventually be processed by the outer family which if different
will check the flag in a different part of the socket then it was set.
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 85108cfbb1ae..d9a0e74d8923 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -326,6 +326,22 @@ static __inline__ void inet_reset_saddr(struct sock *sk) | |||
326 | 326 | ||
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | static inline int sk_mc_loop(struct sock *sk) | ||
330 | { | ||
331 | if (!sk) | ||
332 | return 1; | ||
333 | switch (sk->sk_family) { | ||
334 | case AF_INET: | ||
335 | return inet_sk(sk)->mc_loop; | ||
336 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
337 | case AF_INET6: | ||
338 | return inet6_sk(sk)->mc_loop; | ||
339 | #endif | ||
340 | } | ||
341 | __WARN(); | ||
342 | return 1; | ||
343 | } | ||
344 | |||
329 | extern int ip_call_ra_chain(struct sk_buff *skb); | 345 | extern int ip_call_ra_chain(struct sk_buff *skb); |
330 | 346 | ||
331 | /* | 347 | /* |