Skip to content

Commit 4050137

Browse files
CKI Backport BotHangbin Liu
authored andcommitted
ipv6: Remove setsockopt_needs_rtnl().
JIRA: https://issues.redhat.com/browse/RHEL-115325 commit db38443 Author: Kuniyuki Iwashima <kuniyu@google.com> Date: Wed Jul 2 16:01:32 2025 -0700 ipv6: Remove setsockopt_needs_rtnl(). 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> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 5e26e9f commit 4050137

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

net/ipv6/ipv6_sockglue.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
117117
return opt;
118118
}
119119

120-
static bool setsockopt_needs_rtnl(int optname)
121-
{
122-
return false;
123-
}
124-
125120
static int copy_group_source_from_sockptr(struct group_source_req *greqs,
126121
sockptr_t optval, int optlen)
127122
{
@@ -380,9 +375,8 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
380375
{
381376
struct ipv6_pinfo *np = inet6_sk(sk);
382377
struct net *net = sock_net(sk);
383-
int val, valbool;
384378
int retv = -ENOPROTOOPT;
385-
bool needs_rtnl = setsockopt_needs_rtnl(optname);
379+
int val, valbool;
386380

387381
if (sockptr_is_null(optval))
388382
val = 0;
@@ -547,8 +541,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
547541
return 0;
548542
}
549543
}
550-
if (needs_rtnl)
551-
rtnl_lock();
544+
552545
sockopt_lock_sock(sk);
553546

554547
/* Another thread has converted the socket into IPv4 with
@@ -954,8 +947,6 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
954947

955948
unlock:
956949
sockopt_release_sock(sk);
957-
if (needs_rtnl)
958-
rtnl_unlock();
959950

960951
return retv;
961952

0 commit comments

Comments
 (0)