Skip to content

Commit 75d9b7d

Browse files
q2venNipaLocal
authored and
NipaLocal
committed
arp: Convert SIOCDARP and SIOCSARP to per-netns RTNL.
ioctl(SIOCDARP/SIOCSARP) operates on a single netns fetched from an AF_INET socket in inet_ioctl(). Let's hold rtnl_net_lock() for SIOCDARP and SIOCSARP. Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent d39671b commit 75d9b7d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/ipv4/arp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,8 @@ static int arp_req_set_proxy(struct net *net, struct net_device *dev, int on)
10641064
IPV4_DEVCONF_ALL(net, PROXY_ARP) = on;
10651065
return 0;
10661066
}
1067-
if (__in_dev_get_rtnl(dev)) {
1068-
IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), PROXY_ARP, on);
1067+
if (__in_dev_get_rtnl_net(dev)) {
1068+
IN_DEV_CONF_SET(__in_dev_get_rtnl_net(dev), PROXY_ARP, on);
10691069
return 0;
10701070
}
10711071
return -ENXIO;
@@ -1295,14 +1295,14 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
12951295

12961296
switch (cmd) {
12971297
case SIOCDARP:
1298-
rtnl_lock();
1298+
rtnl_net_lock(net);
12991299
err = arp_req_delete(net, &r);
1300-
rtnl_unlock();
1300+
rtnl_net_unlock(net);
13011301
break;
13021302
case SIOCSARP:
1303-
rtnl_lock();
1303+
rtnl_net_lock(net);
13041304
err = arp_req_set(net, &r);
1305-
rtnl_unlock();
1305+
rtnl_net_unlock(net);
13061306
break;
13071307
case SIOCGARP:
13081308
rcu_read_lock();

0 commit comments

Comments
 (0)