Merge tag 'mm-nonmm-stable-2023-04-27-16-01' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / include / linux / ipv6.h
index 37dfdcfcdd542fe0efc9a1df967be3da931635d4..839247a4f48ea76b5d6daa9a54a7b87627635066 100644 (file)
@@ -336,10 +336,7 @@ static inline struct ipv6_pinfo *inet6_sk(const struct sock *__sk)
        return sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL;
 }
 
-static inline struct raw6_sock *raw6_sk(const struct sock *sk)
-{
-       return (struct raw6_sock *)sk;
-}
+#define raw6_sk(ptr) container_of_const(ptr, struct raw6_sock, inet.sk)
 
 #define ipv6_only_sock(sk)     (sk->sk_ipv6only)
 #define ipv6_sk_rxinfo(sk)     ((sk)->sk_family == PF_INET6 && \