summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-10-09 20:44:02 +0200
committerJakub Kicinski <kuba@kernel.org>2024-10-12 00:35:05 +0200
commit16207384d29287a19f81436e1953b41946aa8258 (patch)
tree8897a7e78e28b8662b52b75c20ca64b7e1c3fb33 /net/ipv4/fib_rules.c
parentfib: rules: use READ_ONCE()/WRITE_ONCE() on ops->fib_rules_seq (diff)
downloadlinux-16207384d29287a19f81436e1953b41946aa8258.tar.xz
linux-16207384d29287a19f81436e1953b41946aa8258.zip
ipv4: use READ_ONCE()/WRITE_ONCE() on net->ipv4.fib_seq
Using RTNL to protect ops->fib_rules_seq reads seems a big hammer. Writes are protected by RTNL. We can use READ_ONCE() when reading it. Constify 'struct net' argument of fib4_rules_seq_read() Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20241009184405.3752829-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--net/ipv4/fib_rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index b07292d50ee7..8325224ef072 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -74,7 +74,7 @@ int fib4_rules_dump(struct net *net, struct notifier_block *nb,
return fib_rules_dump(net, nb, AF_INET, extack);
}
-unsigned int fib4_rules_seq_read(struct net *net)
+unsigned int fib4_rules_seq_read(const struct net *net)
{
return fib_rules_seq_read(net, AF_INET);
}