aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-12 16:01:59 +0000
committerDavid S. Miller <davem@davemloft.net>2023-09-15 10:33:46 +0100
commitb0adfba7ee770fef20b1b6d86706c28f7fccfb07 (patch)
tree4a7a9fe910c850fcc4492d034cf57d0db89c4ae2 /include/net/ipv6.h
parentf2fa1c812c91e99d0317d1fc7d845e1e05f39716 (diff)
downloadlinux-b0adfba7ee770fef20b1b6d86706c28f7fccfb07.tar.gz
ipv6: lockless IPV6_UNICAST_HOPS implementation
Some np->hop_limit accesses are racy, when socket lock is not held. Add missing annotations and switch to full lockless implementation. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c6932d1a3fa80..2e8e7e31e02ea 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -916,7 +916,7 @@ static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6,
if (ipv6_addr_is_multicast(&fl6->daddr))
hlimit = np->mcast_hops;
else
- hlimit = np->hop_limit;
+ hlimit = READ_ONCE(np->hop_limit);
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);
return hlimit;