Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: raw: preserve const qualifier in raw6_sk()

We can change raw6_sk() to propagate its argument const qualifier,
thanks to container_of_const().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
47fcae28 0a2db463

+1 -4
+1 -4
include/linux/ipv6.h
··· 336 336 return sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL; 337 337 } 338 338 339 - static inline struct raw6_sock *raw6_sk(const struct sock *sk) 340 - { 341 - return (struct raw6_sock *)sk; 342 - } 339 + #define raw6_sk(ptr) container_of_const(ptr, struct raw6_sock, inet.sk) 343 340 344 341 #define ipv6_only_sock(sk) (sk->sk_ipv6only) 345 342 #define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \