Commit 39a6d063 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[NETNS]: Process inet_confirm_addr in the correct namespace.

inet_confirm_addr can be called with NULL in_dev from arp_ignore iff
scope is RT_SCOPE_LINK.

Lets always pass the device and check for RT_SCOPE_LINK scope inside
inet_confirm_addr. This let us take network namespace from in_device a
need for an additional argument.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9bd85e32
...@@ -402,7 +402,6 @@ static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) ...@@ -402,7 +402,6 @@ static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
case 3: /* Do not reply for scope host addresses */ case 3: /* Do not reply for scope host addresses */
sip = 0; sip = 0;
scope = RT_SCOPE_LINK; scope = RT_SCOPE_LINK;
in_dev = NULL;
break; break;
case 4: /* Reserved */ case 4: /* Reserved */
case 5: case 5:
......
...@@ -978,13 +978,15 @@ __be32 inet_confirm_addr(struct in_device *in_dev, ...@@ -978,13 +978,15 @@ __be32 inet_confirm_addr(struct in_device *in_dev,
{ {
__be32 addr = 0; __be32 addr = 0;
struct net_device *dev; struct net_device *dev;
struct net *net;
if (in_dev != NULL) if (scope != RT_SCOPE_LINK)
return confirm_addr_indev(in_dev, dst, local, scope); return confirm_addr_indev(in_dev, dst, local, scope);
net = in_dev->dev->nd_net;
read_lock(&dev_base_lock); read_lock(&dev_base_lock);
rcu_read_lock(); rcu_read_lock();
for_each_netdev(&init_net, dev) { for_each_netdev(net, dev) {
if ((in_dev = __in_dev_get_rcu(dev))) { if ((in_dev = __in_dev_get_rcu(dev))) {
addr = confirm_addr_indev(in_dev, dst, local, scope); addr = confirm_addr_indev(in_dev, dst, local, scope);
if (addr) if (addr)
......
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