]> git.ipfire.org Git - thirdparty/linux.git/commit
ipv6: anycast: Don't hold RTNL for IPV6_JOIN_ANYCAST.
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 2 Jul 2025 23:01:31 +0000 (16:01 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Jul 2025 01:32:39 +0000 (18:32 -0700)
commiteb1ac9ff6c4a5720b1a1476233be374c5dc44bff
tree0aec0ddcc7428bbc438e572b0bab7eb9e76f1562
parent976fa9b2054f5b5f5eb5488bdc1a230f734992c4
ipv6: anycast: Don't hold RTNL for IPV6_JOIN_ANYCAST.

inet6_sk(sk)->ipv6_ac_list is protected by lock_sock().

In ipv6_sock_ac_join(), only __dev_get_by_index(), __dev_get_by_flags(),
and __in6_dev_get() require RTNL.

__dev_get_by_flags() is only used by ipv6_sock_ac_join() and can be
converted to RCU version.

Let's replace RCU version helper and drop RTNL from IPV6_JOIN_ANYCAST.

setsockopt_needs_rtnl() will be removed in the next patch.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250702230210.3115355-15-kuni1840@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
net/core/dev.c
net/ipv6/anycast.c
net/ipv6/ipv6_sockglue.c