]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ipv6: Remove setsockopt_needs_rtnl().
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 2 Jul 2025 23:01:32 +0000 (16:01 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Jul 2025 01:32:39 +0000 (18:32 -0700)
We no longer need to hold RTNL for IPv6 socket options.

Let's remove setsockopt_needs_rtnl().

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

index 702dc33e50ad79bfb53c871015be94f2e7fd9527..e66ec623972e08486861b12c99e665d25fda3787 100644 (file)
@@ -117,11 +117,6 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
        return opt;
 }
 
-static bool setsockopt_needs_rtnl(int optname)
-{
-       return false;
-}
-
 static int copy_group_source_from_sockptr(struct group_source_req *greqs,
                sockptr_t optval, int optlen)
 {
@@ -380,9 +375,8 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
 {
        struct ipv6_pinfo *np = inet6_sk(sk);
        struct net *net = sock_net(sk);
-       int val, valbool;
        int retv = -ENOPROTOOPT;
-       bool needs_rtnl = setsockopt_needs_rtnl(optname);
+       int val, valbool;
 
        if (sockptr_is_null(optval))
                val = 0;
@@ -547,8 +541,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                return 0;
        }
        }
-       if (needs_rtnl)
-               rtnl_lock();
+
        sockopt_lock_sock(sk);
 
        /* Another thread has converted the socket into IPv4 with
@@ -954,8 +947,6 @@ done:
 
 unlock:
        sockopt_release_sock(sk);
-       if (needs_rtnl)
-               rtnl_unlock();
 
        return retv;