diff options
author | Eric Dumazet <edumazet@google.com> | 2024-02-02 10:14:03 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-02-05 11:08:06 +0000 |
commit | 89304f91bf8efe832557b00f034493420f16dbdb (patch) | |
tree | 1944185fe39e38c463ab8bbb8e2c0ba829d94f97 /include/net/sctp/structs.h | |
parent | ffabe98cb576097b77d404d39e8b3df03caa986a (diff) | |
download | linux-stable-89304f91bf8efe832557b00f034493420f16dbdb.tar.gz linux-stable-89304f91bf8efe832557b00f034493420f16dbdb.tar.bz2 linux-stable-89304f91bf8efe832557b00f034493420f16dbdb.zip |
sctp: preserve const qualifier in sctp_sk()
We can change sctp_sk() to propagate its argument const qualifier,
thanks to container_of_const().
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r-- | include/net/sctp/structs.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 5a24d6d8522a..f24a1bbcb3ef 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -242,10 +242,7 @@ struct sctp_sock { int do_auto_asconf; }; -static inline struct sctp_sock *sctp_sk(const struct sock *sk) -{ - return (struct sctp_sock *)sk; -} +#define sctp_sk(ptr) container_of_const(ptr, struct sctp_sock, inet.sk) static inline struct sock *sctp_opt2sk(const struct sctp_sock *sp) { |