summaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-02-28 20:52:54 -0800
committerDavid S. Miller <davem@davemloft.net>2008-02-28 20:52:54 -0800
commitc4544c724322984923b3331a4319ae60a62b7803 (patch)
treec92eafe3431c5665d50242156647b5d500028a71 /net/ipv4/devinet.c
parent3776c8891a2d3c5892fa50ab9e2a3b68f5674be6 (diff)
downloadop-kernel-dev-c4544c724322984923b3331a4319ae60a62b7803.zip
op-kernel-dev-c4544c724322984923b3331a4319ae60a62b7803.tar.gz
[NETNS]: Process inet_select_addr inside a namespace.
The context is available from a network device passed in. 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index dfae59b..4a10dbb 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;
OpenPOWER on IntegriCloud