Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232448
b: refs/heads/master
c: c506653
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 24, 2011
1 parent c9e3efa commit b848570
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a0b7a5f7a043d86a95990d3227cf7e823ae52ac
refs/heads/master: c506653d35249bb4738bb139c24362e1ae724bc1
3 changes: 2 additions & 1 deletion trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ EXPORT_SYMBOL(dev_get_by_index);
* @ha: hardware address
*
* Search for an interface by MAC address. Returns NULL if the device
* is not found or a pointer to the device. The caller must hold RCU
* is not found or a pointer to the device.
* The caller must hold RCU or RTNL.
* The returned device has not had its ref count increased
* and the caller must therefore be careful about locking
*
Expand Down
11 changes: 5 additions & 6 deletions trunk/net/ipv4/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,13 @@ static int arp_req_set_proxy(struct net *net, struct net_device *dev, int on)
IPV4_DEVCONF_ALL(net, PROXY_ARP) = on;
return 0;
}
if (__in_dev_get_rcu(dev)) {
IN_DEV_CONF_SET(__in_dev_get_rcu(dev), PROXY_ARP, on);
if (__in_dev_get_rtnl(dev)) {
IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), PROXY_ARP, on);
return 0;
}
return -ENXIO;
}

/* must be called with rcu_read_lock() */
static int arp_req_set_public(struct net *net, struct arpreq *r,
struct net_device *dev)
{
Expand Down Expand Up @@ -1233,10 +1232,10 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
if (!(r.arp_flags & ATF_NETMASK))
((struct sockaddr_in *)&r.arp_netmask)->sin_addr.s_addr =
htonl(0xFFFFFFFFUL);
rcu_read_lock();
rtnl_lock();
if (r.arp_dev[0]) {
err = -ENODEV;
dev = dev_get_by_name_rcu(net, r.arp_dev);
dev = __dev_get_by_name(net, r.arp_dev);
if (dev == NULL)
goto out;

Expand All @@ -1263,7 +1262,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
break;
}
out:
rcu_read_unlock();
rtnl_unlock();
if (cmd == SIOCGARP && !err && copy_to_user(arg, &r, sizeof(r)))
err = -EFAULT;
return err;
Expand Down

0 comments on commit b848570

Please sign in to comment.