summaryrefslogtreecommitdiff
path: root/net/ipv6/fib6_rules.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-10-09 18:44:03 +0000
committerJakub Kicinski <kuba@kernel.org>2024-10-11 15:35:05 -0700
commite60ea45447768c48309b944596a8a34f6bae50e2 (patch)
treefc1830061b00718564b760fe1239ffcbdb37f321 /net/ipv6/fib6_rules.c
parent16207384d29287a19f81436e1953b41946aa8258 (diff)
downloadlinux-e60ea45447768c48309b944596a8a34f6bae50e2.tar.gz
linux-e60ea45447768c48309b944596a8a34f6bae50e2.tar.bz2
linux-e60ea45447768c48309b944596a8a34f6bae50e2.zip
ipv6: use READ_ONCE()/WRITE_ONCE() on fib6_table->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 fib6_tables_seq_read() and fib6_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-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r--net/ipv6/fib6_rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 04a9ed5e8310..c85c1627cb16 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -56,7 +56,7 @@ int fib6_rules_dump(struct net *net, struct notifier_block *nb,
return fib_rules_dump(net, nb, AF_INET6, extack);
}
-unsigned int fib6_rules_seq_read(struct net *net)
+unsigned int fib6_rules_seq_read(const struct net *net)
{
return fib_rules_seq_read(net, AF_INET6);
}