summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-01-20 12:53:53 +0000
committerJakub Kicinski <kuba@kernel.org>2026-01-21 19:20:04 -0800
commita4674aa58be53921f2aba62e143cc338d6ab142c (patch)
tree3d9f532370c447ac8d36768f866bdfb362ab8341 /include/linux
parent1b58c94e9cf928970d5287550d3005389b198ff9 (diff)
tcp: preserve const qualifier in tcp_rsk() and inet_rsk()
We can change tcp_rsk() and inet_rsk() to propagate their argument const qualifier thanks to container_of_const(). Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260120125353.1470456-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tcp.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 20b8c6e21fef..367b491ddf97 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -181,10 +181,7 @@ struct tcp_request_sock {
#endif
};
-static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
-{
- return (struct tcp_request_sock *)req;
-}
+#define tcp_rsk(ptr) container_of_const(ptr, struct tcp_request_sock, req.req)
static inline bool tcp_rsk_used_ao(const struct request_sock *req)
{