aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_ioctl.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <[email protected]>2024-10-21 18:32:39 +0000
committerPaolo Abeni <[email protected]>2024-10-29 10:54:58 +0000
commit7ed8da17bfb2b033e42afa842ca22641821e231c (patch)
treee6bb3dcd48a5665699fb5dcf4825407a5e3f518b /net/core/dev_ioctl.c
parentipv4: Convert devinet_ioctl() to per-netns RTNL except for SIOCSIFFLAGS. (diff)
downloadkernel-7ed8da17bfb2b033e42afa842ca22641821e231c.tar.gz
kernel-7ed8da17bfb2b033e42afa842ca22641821e231c.zip
ipv4: Convert devinet_ioctl to per-netns RTNL.
ioctl(SIOCGIFCONF) calls dev_ifconf() that operates on the current netns. Let's use per-netns RTNL helpers in dev_ifconf() and inet_gifconf(). Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/dev_ioctl.c')
-rw-r--r--net/core/dev_ioctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 473c437b6b53..46d43b950471 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -64,7 +64,7 @@ int dev_ifconf(struct net *net, struct ifconf __user *uifc)
}
/* Loop over the interfaces, and write an info block for each. */
- rtnl_lock();
+ rtnl_net_lock(net);
for_each_netdev(net, dev) {
if (!pos)
done = inet_gifconf(dev, NULL, 0, size);
@@ -72,12 +72,12 @@ int dev_ifconf(struct net *net, struct ifconf __user *uifc)
done = inet_gifconf(dev, pos + total,
len - total, size);
if (done < 0) {
- rtnl_unlock();
+ rtnl_net_unlock(net);
return -EFAULT;
}
total += done;
}
- rtnl_unlock();
+ rtnl_net_unlock(net);
return put_user(total, &uifc->ifc_len);
}