aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r--net/ipv4/devinet.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index c5eb1a29a5cf..721b89b60963 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -420,7 +420,7 @@ struct in_device *inetdev_by_index(int ifindex)
420 struct net_device *dev; 420 struct net_device *dev;
421 struct in_device *in_dev = NULL; 421 struct in_device *in_dev = NULL;
422 read_lock(&dev_base_lock); 422 read_lock(&dev_base_lock);
423 dev = __dev_get_by_index(ifindex); 423 dev = __dev_get_by_index(&init_net, ifindex);
424 if (dev) 424 if (dev)
425 in_dev = in_dev_get(dev); 425 in_dev = in_dev_get(dev);
426 read_unlock(&dev_base_lock); 426 read_unlock(&dev_base_lock);
@@ -506,7 +506,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
506 goto errout; 506 goto errout;
507 } 507 }
508 508
509 dev = __dev_get_by_index(ifm->ifa_index); 509 dev = __dev_get_by_index(&init_net, ifm->ifa_index);
510 if (dev == NULL) { 510 if (dev == NULL) {
511 err = -ENODEV; 511 err = -ENODEV;
512 goto errout; 512 goto errout;
@@ -628,7 +628,7 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
628 *colon = 0; 628 *colon = 0;
629 629
630#ifdef CONFIG_KMOD 630#ifdef CONFIG_KMOD
631 dev_load(ifr.ifr_name); 631 dev_load(&init_net, ifr.ifr_name);
632#endif 632#endif
633 633
634 switch (cmd) { 634 switch (cmd) {
@@ -669,7 +669,7 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
669 rtnl_lock(); 669 rtnl_lock();
670 670
671 ret = -ENODEV; 671 ret = -ENODEV;
672 if ((dev = __dev_get_by_name(ifr.ifr_name)) == NULL) 672 if ((dev = __dev_get_by_name(&init_net, ifr.ifr_name)) == NULL)
673 goto done; 673 goto done;
674 674
675 if (colon) 675 if (colon)
@@ -909,7 +909,7 @@ no_in_dev:
909 */ 909 */
910 read_lock(&dev_base_lock); 910 read_lock(&dev_base_lock);
911 rcu_read_lock(); 911 rcu_read_lock();
912 for_each_netdev(dev) { 912 for_each_netdev(&init_net, dev) {
913 if ((in_dev = __in_dev_get_rcu(dev)) == NULL) 913 if ((in_dev = __in_dev_get_rcu(dev)) == NULL)
914 continue; 914 continue;
915 915
@@ -988,7 +988,7 @@ __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local,
988 988
989 read_lock(&dev_base_lock); 989 read_lock(&dev_base_lock);
990 rcu_read_lock(); 990 rcu_read_lock();
991 for_each_netdev(dev) { 991 for_each_netdev(&init_net, dev) {
992 if ((in_dev = __in_dev_get_rcu(dev))) { 992 if ((in_dev = __in_dev_get_rcu(dev))) {
993 addr = confirm_addr_indev(in_dev, dst, local, scope); 993 addr = confirm_addr_indev(in_dev, dst, local, scope);
994 if (addr) 994 if (addr)
@@ -1185,7 +1185,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
1185 1185
1186 s_ip_idx = ip_idx = cb->args[1]; 1186 s_ip_idx = ip_idx = cb->args[1];
1187 idx = 0; 1187 idx = 0;
1188 for_each_netdev(dev) { 1188 for_each_netdev(&init_net, dev) {
1189 if (idx < s_idx) 1189 if (idx < s_idx)
1190 goto cont; 1190 goto cont;
1191 if (idx > s_idx) 1191 if (idx > s_idx)
@@ -1244,7 +1244,7 @@ static void devinet_copy_dflt_conf(int i)
1244 struct net_device *dev; 1244 struct net_device *dev;
1245 1245
1246 read_lock(&dev_base_lock); 1246 read_lock(&dev_base_lock);
1247 for_each_netdev(dev) { 1247 for_each_netdev(&init_net, dev) {
1248 struct in_device *in_dev; 1248 struct in_device *in_dev;
1249 rcu_read_lock(); 1249 rcu_read_lock();
1250 in_dev = __in_dev_get_rcu(dev); 1250 in_dev = __in_dev_get_rcu(dev);
@@ -1333,7 +1333,7 @@ void inet_forward_change(void)
1333 IPV4_DEVCONF_DFLT(FORWARDING) = on; 1333 IPV4_DEVCONF_DFLT(FORWARDING) = on;
1334 1334
1335 read_lock(&dev_base_lock); 1335 read_lock(&dev_base_lock);
1336 for_each_netdev(dev) { 1336 for_each_netdev(&init_net, dev) {
1337 struct in_device *in_dev; 1337 struct in_device *in_dev;
1338 rcu_read_lock(); 1338 rcu_read_lock();
1339 in_dev = __in_dev_get_rcu(dev); 1339 in_dev = __in_dev_get_rcu(dev);