Commit 2db82b53 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[NETNS]: Make arp code network namespace consistent.

Some calls in the arp.c have network namespace as an argument. Getting
init_net inside these functions is simply inconsistent. Fix this.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a79878f0
...@@ -973,13 +973,13 @@ static int arp_req_set_public(struct net *net, struct arpreq *r, ...@@ -973,13 +973,13 @@ static int arp_req_set_public(struct net *net, struct arpreq *r,
if (mask && mask != htonl(0xFFFFFFFF)) if (mask && mask != htonl(0xFFFFFFFF))
return -EINVAL; return -EINVAL;
if (!dev && (r->arp_flags & ATF_COM)) { if (!dev && (r->arp_flags & ATF_COM)) {
dev = dev_getbyhwaddr(&init_net, r->arp_ha.sa_family, dev = dev_getbyhwaddr(net, r->arp_ha.sa_family,
r->arp_ha.sa_data); r->arp_ha.sa_data);
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
} }
if (mask) { if (mask) {
if (pneigh_lookup(&arp_tbl, &init_net, &ip, dev, 1) == NULL) if (pneigh_lookup(&arp_tbl, net, &ip, dev, 1) == NULL)
return -ENOBUFS; return -ENOBUFS;
return 0; return 0;
} }
...@@ -1088,7 +1088,7 @@ static int arp_req_delete_public(struct net *net, struct arpreq *r, ...@@ -1088,7 +1088,7 @@ static int arp_req_delete_public(struct net *net, struct arpreq *r,
__be32 mask = ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr; __be32 mask = ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr;
if (mask == htonl(0xFFFFFFFF)) if (mask == htonl(0xFFFFFFFF))
return pneigh_delete(&arp_tbl, &init_net, &ip, dev); return pneigh_delete(&arp_tbl, net, &ip, dev);
if (mask) if (mask)
return -EINVAL; return -EINVAL;
...@@ -1166,7 +1166,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg) ...@@ -1166,7 +1166,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
rtnl_lock(); rtnl_lock();
if (r.arp_dev[0]) { if (r.arp_dev[0]) {
err = -ENODEV; err = -ENODEV;
if ((dev = __dev_get_by_name(&init_net, r.arp_dev)) == NULL) if ((dev = __dev_get_by_name(net, r.arp_dev)) == NULL)
goto out; goto out;
/* Mmmm... It is wrong... ARPHRD_NETROM==0 */ /* Mmmm... It is wrong... ARPHRD_NETROM==0 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment