diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 2 | ||||
-rw-r--r-- | net/ipv6/anycast.c | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ad4598fcc416..6b6a373a30b2 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1725,7 +1725,7 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp) | |||
1725 | ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); | 1725 | ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); |
1726 | if (ipv6_addr_any(&addr)) | 1726 | if (ipv6_addr_any(&addr)) |
1727 | return; | 1727 | return; |
1728 | ipv6_dev_ac_inc(ifp->idev->dev, &addr); | 1728 | __ipv6_dev_ac_inc(ifp->idev, &addr); |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | /* caller must hold RTNL */ | 1731 | /* caller must hold RTNL */ |
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index d10f2e2b49c6..66c19320119a 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -122,7 +122,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr) | |||
122 | goto error; | 122 | goto error; |
123 | } | 123 | } |
124 | 124 | ||
125 | err = ipv6_dev_ac_inc(dev, addr); | 125 | err = __ipv6_dev_ac_inc(idev, addr); |
126 | if (!err) { | 126 | if (!err) { |
127 | pac->acl_next = np->ipv6_ac_list; | 127 | pac->acl_next = np->ipv6_ac_list; |
128 | np->ipv6_ac_list = pac; | 128 | np->ipv6_ac_list = pac; |
@@ -215,20 +215,15 @@ static void aca_put(struct ifacaddr6 *ac) | |||
215 | /* | 215 | /* |
216 | * device anycast group inc (add if not found) | 216 | * device anycast group inc (add if not found) |
217 | */ | 217 | */ |
218 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr) | 218 | int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr) |
219 | { | 219 | { |
220 | struct ifacaddr6 *aca; | 220 | struct ifacaddr6 *aca; |
221 | struct inet6_dev *idev; | ||
222 | struct rt6_info *rt; | 221 | struct rt6_info *rt; |
223 | int err; | 222 | int err; |
224 | 223 | ||
225 | ASSERT_RTNL(); | 224 | ASSERT_RTNL(); |
226 | 225 | ||
227 | idev = in6_dev_get(dev); | 226 | in6_dev_hold(idev); |
228 | |||
229 | if (idev == NULL) | ||
230 | return -EINVAL; | ||
231 | |||
232 | write_lock_bh(&idev->lock); | 227 | write_lock_bh(&idev->lock); |
233 | if (idev->dead) { | 228 | if (idev->dead) { |
234 | err = -ENODEV; | 229 | err = -ENODEV; |
@@ -276,7 +271,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr) | |||
276 | 271 | ||
277 | ip6_ins_rt(rt); | 272 | ip6_ins_rt(rt); |
278 | 273 | ||
279 | addrconf_join_solict(dev, &aca->aca_addr); | 274 | addrconf_join_solict(idev->dev, &aca->aca_addr); |
280 | 275 | ||
281 | aca_put(aca); | 276 | aca_put(aca); |
282 | return 0; | 277 | return 0; |