ip: fix mc_loop checks for tunnels with multicast outer addresses
[linux-2.6.git] / include / net / ip.h
index 85108cf..d9a0e74 100644 (file)
@@ -326,6 +326,22 @@ static __inline__ void inet_reset_saddr(struct sock *sk)
 
 #endif
 
+static inline int sk_mc_loop(struct sock *sk)
+{
+       if (!sk)
+               return 1;
+       switch (sk->sk_family) {
+       case AF_INET:
+               return inet_sk(sk)->mc_loop;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+       case AF_INET6:
+               return inet6_sk(sk)->mc_loop;
+#endif
+       }
+       __WARN();
+       return 1;
+}
+
 extern int     ip_call_ra_chain(struct sk_buff *skb);
 
 /*