Skip to content

Commit

Permalink
[NETNS]: Process inet_select_addr inside a namespace.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Feb 29, 2008
1 parent 3776c88 commit c4544c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/devinet.c
Original file line number Diff line number Diff line change
@@ -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 @@ __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope)
*/
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;

0 comments on commit c4544c7

Please sign in to comment.