diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-17 15:55:32 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-18 12:23:33 +0000 |
commit | 0a2db4630b72486ec2f207ae433c2156b7fd3837 (patch) | |
tree | eaf6f41ccdf15a05668ca0d1133d267c02ef548b /include/net | |
parent | 68ac9a8b6e65c7cbbe96541353dab1b3f8de2043 (diff) |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/raw.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/raw.h b/include/net/raw.h index 7ad15830cf38..c215af02f758 100644 --- a/include/net/raw.h +++ b/include/net/raw.h @@ -83,10 +83,7 @@ struct raw_sock { u32 ipmr_table; }; -static inline struct raw_sock *raw_sk(const struct sock *sk) -{ - return (struct raw_sock *)sk; -} +#define raw_sk(ptr) container_of_const(ptr, struct raw_sock, inet.sk) static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if, int dif, int sdif) |