aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-15 02:06:19 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:13 -0500
commit39a6d06300128d32f361f4f790beba0ca83730eb (patch)
tree7f47f52708e17eed923cfbbc56e348ab4c573cb9 /net/ipv4/devinet.c
parent9bd85e32644d4d3744117b0a196ad4382f8acf35 (diff)
[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: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r--net/ipv4/devinet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index dc1665a2b075..e381edb19b23 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -978,13 +978,15 @@ __be32 inet_confirm_addr(struct in_device *in_dev,
978{ 978{
979 __be32 addr = 0; 979 __be32 addr = 0;
980 struct net_device *dev; 980 struct net_device *dev;
981 struct net *net;
981 982
982 if (in_dev != NULL) 983 if (scope != RT_SCOPE_LINK)
983 return confirm_addr_indev(in_dev, dst, local, scope); 984 return confirm_addr_indev(in_dev, dst, local, scope);
984 985
986 net = in_dev->dev->nd_net;
985 read_lock(&dev_base_lock); 987 read_lock(&dev_base_lock);
986 rcu_read_lock(); 988 rcu_read_lock();
987 for_each_netdev(&init_net, dev) { 989 for_each_netdev(net, dev) {
988 if ((in_dev = __in_dev_get_rcu(dev))) { 990 if ((in_dev = __in_dev_get_rcu(dev))) {
989 addr = confirm_addr_indev(in_dev, dst, local, scope); 991 addr = confirm_addr_indev(in_dev, dst, local, scope);
990 if (addr) 992 if (addr)