From: Denis V. Lunev Date: Fri, 29 Feb 2008 04:52:54 +0000 (-0800) Subject: [NETNS]: Process inet_select_addr inside a namespace. X-Git-Tag: v2.6.26-rc1~1138^2~556 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c4544c724322984923b3331a4319ae60a62b7803;p=linux-2.6-omap-h63xx.git [NETNS]: Process inet_select_addr inside a namespace. The context is available from a network device passed in. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index dfae59bfaa2..4a10dbbbe0a 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -872,6 +872,7 @@ __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope) { __be32 addr = 0; struct in_device *in_dev; + struct net *net = dev->nd_net; rcu_read_lock(); in_dev = __in_dev_get_rcu(dev); @@ -900,7 +901,7 @@ no_in_dev: */ read_lock(&dev_base_lock); rcu_read_lock(); - for_each_netdev(&init_net, dev) { + for_each_netdev(net, dev) { if ((in_dev = __in_dev_get_rcu(dev)) == NULL) continue;