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

raw: preserve const qualifier in raw_sk()

We can change raw_sk() to propagate const qualifier of its argument,
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
0a2db463 68ac9a8b

+1 -4
+1 -4
include/net/raw.h
··· 83 83 u32 ipmr_table; 84 84 }; 85 85 86 - static inline struct raw_sock *raw_sk(const struct sock *sk) 87 - { 88 - return (struct raw_sock *)sk; 89 - } 86 + #define raw_sk(ptr) container_of_const(ptr, struct raw_sock, inet.sk) 90 87 91 88 static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if, 92 89 int dif, int sdif)