aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-02-29 11:40:15 +0000
committerDavid S. Miller <davem@davemloft.net>2024-03-01 11:09:39 +0000
commit590e92cdc835fcf435d8611f2477fff0e16877c7 (patch)
tree1e0dca619cc99d70fcbeafe97e2ace42b1814ee1 /net/ipv4
parentinet: annotate data-races around ifa->ifa_flags (diff)
downloadwireguard-linux-590e92cdc835fcf435d8611f2477fff0e16877c7.tar.xz
wireguard-linux-590e92cdc835fcf435d8611f2477fff0e16877c7.zip
inet: prepare inet_base_seq() to run without RTNL
In the following patch, inet_base_seq() will no longer be called with RTNL held. Add READ_ONCE()/WRITE_ONCE() annotations in dev_base_seq_inc() and inet_base_seq(). Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/devinet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 550b775cbbf3..2afe78dfc3c2 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1837,7 +1837,7 @@ done:
static u32 inet_base_seq(const struct net *net)
{
u32 res = atomic_read(&net->ipv4.dev_addr_genid) +
- net->dev_base_seq;
+ READ_ONCE(net->dev_base_seq);
/* Must not return 0 (see nl_dump_check_consistent()).
* Chose a value far away from 0.