diff options
author | Eric Dumazet <edumazet@google.com> | 2024-02-28 14:54:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-03-01 09:42:31 +0100 |
commit | 32f754176e889cdfe989ef08ece19859427755df (patch) | |
tree | af0f0215d2574da45535a83add3e4336d5c16d59 /include/net/ipv6.h | |
parent | ipv6: annotate data-races around cnf.hop_limit (diff) | |
download | linux-32f754176e889cdfe989ef08ece19859427755df.tar.xz linux-32f754176e889cdfe989ef08ece19859427755df.zip |
ipv6: annotate data-races around cnf.forwarding
idev->cnf.forwarding and net->ipv6.devconf_all->forwarding
might be read locklessly, add appropriate READ_ONCE()
and WRITE_ONCE() annotations.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index cf25ea21d770..88a8e554f7a1 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -534,13 +534,15 @@ static inline int ipv6_hopopt_jumbo_remove(struct sk_buff *skb) return 0; } -static inline bool ipv6_accept_ra(struct inet6_dev *idev) +static inline bool ipv6_accept_ra(const struct inet6_dev *idev) { + s32 accept_ra = READ_ONCE(idev->cnf.accept_ra); + /* If forwarding is enabled, RA are not accepted unless the special * hybrid mode (accept_ra=2) is enabled. */ - return idev->cnf.forwarding ? idev->cnf.accept_ra == 2 : - idev->cnf.accept_ra; + return READ_ONCE(idev->cnf.forwarding) ? accept_ra == 2 : + accept_ra; } #define IPV6_FRAG_HIGH_THRESH (4 * 1024*1024) /* 4194304 */ |