diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-17 18:55:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-18 15:23:33 +0300 |
commit | 47fcae28b9ec409423ba7f67f93e8345acce8a36 (patch) | |
tree | af2c4ed8f381ef9c190af46bbd28d9a2b1f8ccef /include/linux | |
parent | 0a2db4630b72486ec2f207ae433c2156b7fd3837 (diff) | |
download | linux-47fcae28b9ec409423ba7f67f93e8345acce8a36.tar.xz |
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>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ipv6.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 37dfdcfcdd54..839247a4f48e 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -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 && \ |