summaryrefslogtreecommitdiff
path: root/include/net/inet_sock.h
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/net/inet_sock.h
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/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 3370159556b8..903b2263ec80 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -100,10 +100,7 @@ struct inet_request_sock {
};
};
-static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
-{
- return (struct inet_request_sock *)sk;
-}
+#define inet_rsk(ptr) container_of_const(ptr, struct inet_request_sock, req)
static inline u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb)
{