summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-01-15 09:41:36 +0000
committerJakub Kicinski <kuba@kernel.org>2026-01-19 09:56:42 -0800
commit3681282530e68a507dfd8cb58f04a10b41282ab3 (patch)
tree72006e7cd48411bfb6535967080c04ead8367e9a /include
parentded139b59b5df3c8dbeb2d63685efdc715fc4434 (diff)
ipv6: annotate date-race in ipv6_can_nonlocal_bind()
Add a missing READ_ONCE(), and add const qualifiers to the two parameters. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260115094141.3124990-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/ipv6.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 7873b34181d9..f39cd85e8912 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -931,10 +931,10 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow,
#if IS_ENABLED(CONFIG_IPV6)
-static inline bool ipv6_can_nonlocal_bind(struct net *net,
- struct inet_sock *inet)
+static inline bool ipv6_can_nonlocal_bind(const struct net *net,
+ const struct inet_sock *inet)
{
- return net->ipv6.sysctl.ip_nonlocal_bind ||
+ return READ_ONCE(net->ipv6.sysctl.ip_nonlocal_bind) ||
test_bit(INET_FLAGS_FREEBIND, &inet->inet_flags) ||
test_bit(INET_FLAGS_TRANSPARENT, &inet->inet_flags);
}