aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 dfae59bfaa2c..4a10dbbbe0a1 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)
872{ 872{
873 __be32 addr = 0; 873 __be32 addr = 0;
874 struct in_device *in_dev; 874 struct in_device *in_dev;
875 struct net *net = dev->nd_net;
875 876
876 rcu_read_lock(); 877 rcu_read_lock();
877 in_dev = __in_dev_get_rcu(dev); 878 in_dev = __in_dev_get_rcu(dev);
@@ -900,7 +901,7 @@ no_in_dev:
900 */ 901 */
901 read_lock(&dev_base_lock); 902 read_lock(&dev_base_lock);
902 rcu_read_lock(); 903 rcu_read_lock();
903 for_each_netdev(&init_net, dev) { 904 for_each_netdev(net, dev) {
904 if ((in_dev = __in_dev_get_rcu(dev)) == NULL) 905 if ((in_dev = __in_dev_get_rcu(dev)) == NULL)
905 continue; 906 continue;
906 907