diff options
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1a6783646520..ee55be975407 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -450,7 +450,7 @@ static void addrconf_forward_change(void) | |||
450 | struct inet6_dev *idev; | 450 | struct inet6_dev *idev; |
451 | 451 | ||
452 | read_lock(&dev_base_lock); | 452 | read_lock(&dev_base_lock); |
453 | for_each_netdev(dev) { | 453 | for_each_netdev(&init_net, dev) { |
454 | rcu_read_lock(); | 454 | rcu_read_lock(); |
455 | idev = __in6_dev_get(dev); | 455 | idev = __in6_dev_get(dev); |
456 | if (idev) { | 456 | if (idev) { |
@@ -912,7 +912,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, | |||
912 | read_lock(&dev_base_lock); | 912 | read_lock(&dev_base_lock); |
913 | rcu_read_lock(); | 913 | rcu_read_lock(); |
914 | 914 | ||
915 | for_each_netdev(dev) { | 915 | for_each_netdev(&init_net, dev) { |
916 | struct inet6_dev *idev; | 916 | struct inet6_dev *idev; |
917 | struct inet6_ifaddr *ifa; | 917 | struct inet6_ifaddr *ifa; |
918 | 918 | ||
@@ -1858,7 +1858,7 @@ int addrconf_set_dstaddr(void __user *arg) | |||
1858 | if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) | 1858 | if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) |
1859 | goto err_exit; | 1859 | goto err_exit; |
1860 | 1860 | ||
1861 | dev = __dev_get_by_index(ireq.ifr6_ifindex); | 1861 | dev = __dev_get_by_index(&init_net, ireq.ifr6_ifindex); |
1862 | 1862 | ||
1863 | err = -ENODEV; | 1863 | err = -ENODEV; |
1864 | if (dev == NULL) | 1864 | if (dev == NULL) |
@@ -1889,7 +1889,7 @@ int addrconf_set_dstaddr(void __user *arg) | |||
1889 | 1889 | ||
1890 | if (err == 0) { | 1890 | if (err == 0) { |
1891 | err = -ENOBUFS; | 1891 | err = -ENOBUFS; |
1892 | if ((dev = __dev_get_by_name(p.name)) == NULL) | 1892 | if ((dev = __dev_get_by_name(&init_net, p.name)) == NULL) |
1893 | goto err_exit; | 1893 | goto err_exit; |
1894 | err = dev_open(dev); | 1894 | err = dev_open(dev); |
1895 | } | 1895 | } |
@@ -1919,7 +1919,7 @@ static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen, | |||
1919 | if (!valid_lft || prefered_lft > valid_lft) | 1919 | if (!valid_lft || prefered_lft > valid_lft) |
1920 | return -EINVAL; | 1920 | return -EINVAL; |
1921 | 1921 | ||
1922 | if ((dev = __dev_get_by_index(ifindex)) == NULL) | 1922 | if ((dev = __dev_get_by_index(&init_net, ifindex)) == NULL) |
1923 | return -ENODEV; | 1923 | return -ENODEV; |
1924 | 1924 | ||
1925 | if ((idev = addrconf_add_dev(dev)) == NULL) | 1925 | if ((idev = addrconf_add_dev(dev)) == NULL) |
@@ -1970,7 +1970,7 @@ static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen) | |||
1970 | struct inet6_dev *idev; | 1970 | struct inet6_dev *idev; |
1971 | struct net_device *dev; | 1971 | struct net_device *dev; |
1972 | 1972 | ||
1973 | if ((dev = __dev_get_by_index(ifindex)) == NULL) | 1973 | if ((dev = __dev_get_by_index(&init_net, ifindex)) == NULL) |
1974 | return -ENODEV; | 1974 | return -ENODEV; |
1975 | 1975 | ||
1976 | if ((idev = __in6_dev_get(dev)) == NULL) | 1976 | if ((idev = __in6_dev_get(dev)) == NULL) |
@@ -2065,7 +2065,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev) | |||
2065 | return; | 2065 | return; |
2066 | } | 2066 | } |
2067 | 2067 | ||
2068 | for_each_netdev(dev) { | 2068 | for_each_netdev(&init_net, dev) { |
2069 | struct in_device * in_dev = __in_dev_get_rtnl(dev); | 2069 | struct in_device * in_dev = __in_dev_get_rtnl(dev); |
2070 | if (in_dev && (dev->flags & IFF_UP)) { | 2070 | if (in_dev && (dev->flags & IFF_UP)) { |
2071 | struct in_ifaddr * ifa; | 2071 | struct in_ifaddr * ifa; |
@@ -2221,12 +2221,12 @@ static void ip6_tnl_add_linklocal(struct inet6_dev *idev) | |||
2221 | 2221 | ||
2222 | /* first try to inherit the link-local address from the link device */ | 2222 | /* first try to inherit the link-local address from the link device */ |
2223 | if (idev->dev->iflink && | 2223 | if (idev->dev->iflink && |
2224 | (link_dev = __dev_get_by_index(idev->dev->iflink))) { | 2224 | (link_dev = __dev_get_by_index(&init_net, idev->dev->iflink))) { |
2225 | if (!ipv6_inherit_linklocal(idev, link_dev)) | 2225 | if (!ipv6_inherit_linklocal(idev, link_dev)) |
2226 | return; | 2226 | return; |
2227 | } | 2227 | } |
2228 | /* then try to inherit it from any device */ | 2228 | /* then try to inherit it from any device */ |
2229 | for_each_netdev(link_dev) { | 2229 | for_each_netdev(&init_net, link_dev) { |
2230 | if (!ipv6_inherit_linklocal(idev, link_dev)) | 2230 | if (!ipv6_inherit_linklocal(idev, link_dev)) |
2231 | return; | 2231 | return; |
2232 | } | 2232 | } |
@@ -3084,7 +3084,7 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
3084 | valid_lft = INFINITY_LIFE_TIME; | 3084 | valid_lft = INFINITY_LIFE_TIME; |
3085 | } | 3085 | } |
3086 | 3086 | ||
3087 | dev = __dev_get_by_index(ifm->ifa_index); | 3087 | dev = __dev_get_by_index(&init_net, ifm->ifa_index); |
3088 | if (dev == NULL) | 3088 | if (dev == NULL) |
3089 | return -ENODEV; | 3089 | return -ENODEV; |
3090 | 3090 | ||
@@ -3268,7 +3268,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, | |||
3268 | s_ip_idx = ip_idx = cb->args[1]; | 3268 | s_ip_idx = ip_idx = cb->args[1]; |
3269 | 3269 | ||
3270 | idx = 0; | 3270 | idx = 0; |
3271 | for_each_netdev(dev) { | 3271 | for_each_netdev(&init_net, dev) { |
3272 | if (idx < s_idx) | 3272 | if (idx < s_idx) |
3273 | goto cont; | 3273 | goto cont; |
3274 | if (idx > s_idx) | 3274 | if (idx > s_idx) |
@@ -3377,7 +3377,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh, | |||
3377 | 3377 | ||
3378 | ifm = nlmsg_data(nlh); | 3378 | ifm = nlmsg_data(nlh); |
3379 | if (ifm->ifa_index) | 3379 | if (ifm->ifa_index) |
3380 | dev = __dev_get_by_index(ifm->ifa_index); | 3380 | dev = __dev_get_by_index(&init_net, ifm->ifa_index); |
3381 | 3381 | ||
3382 | if ((ifa = ipv6_get_ifaddr(addr, dev, 1)) == NULL) { | 3382 | if ((ifa = ipv6_get_ifaddr(addr, dev, 1)) == NULL) { |
3383 | err = -EADDRNOTAVAIL; | 3383 | err = -EADDRNOTAVAIL; |
@@ -3589,7 +3589,7 @@ static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | |||
3589 | 3589 | ||
3590 | read_lock(&dev_base_lock); | 3590 | read_lock(&dev_base_lock); |
3591 | idx = 0; | 3591 | idx = 0; |
3592 | for_each_netdev(dev) { | 3592 | for_each_netdev(&init_net, dev) { |
3593 | if (idx < s_idx) | 3593 | if (idx < s_idx) |
3594 | goto cont; | 3594 | goto cont; |
3595 | if ((idev = in6_dev_get(dev)) == NULL) | 3595 | if ((idev = in6_dev_get(dev)) == NULL) |
@@ -4266,7 +4266,7 @@ void __exit addrconf_cleanup(void) | |||
4266 | * clean dev list. | 4266 | * clean dev list. |
4267 | */ | 4267 | */ |
4268 | 4268 | ||
4269 | for_each_netdev(dev) { | 4269 | for_each_netdev(&init_net, dev) { |
4270 | if (__in6_dev_get(dev) == NULL) | 4270 | if (__in6_dev_get(dev) == NULL) |
4271 | continue; | 4271 | continue; |
4272 | addrconf_ifdown(dev, 1); | 4272 | addrconf_ifdown(dev, 1); |