summaryrefslogtreecommitdiffstats
path: root/net/ipv6/anycast.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/anycast.c')
-rw-r--r--net/ipv6/anycast.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index e456386fe4d5..3db8fe10322b 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -213,7 +213,7 @@ static void aca_put(struct ifacaddr6 *ac)
213{ 213{
214 if (refcount_dec_and_test(&ac->aca_refcnt)) { 214 if (refcount_dec_and_test(&ac->aca_refcnt)) {
215 in6_dev_put(ac->aca_idev); 215 in6_dev_put(ac->aca_idev);
216 dst_release(&ac->aca_rt->dst); 216 fib6_info_release(ac->aca_rt);
217 kfree(ac); 217 kfree(ac);
218 } 218 }
219} 219}
@@ -231,6 +231,7 @@ static struct ifacaddr6 *aca_alloc(struct rt6_info *rt,
231 aca->aca_addr = *addr; 231 aca->aca_addr = *addr;
232 in6_dev_hold(idev); 232 in6_dev_hold(idev);
233 aca->aca_idev = idev; 233 aca->aca_idev = idev;
234 fib6_info_hold(rt);
234 aca->aca_rt = rt; 235 aca->aca_rt = rt;
235 aca->aca_users = 1; 236 aca->aca_users = 1;
236 /* aca_tstamp should be updated upon changes */ 237 /* aca_tstamp should be updated upon changes */
@@ -274,7 +275,7 @@ int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
274 } 275 }
275 aca = aca_alloc(rt, addr); 276 aca = aca_alloc(rt, addr);
276 if (!aca) { 277 if (!aca) {
277 ip6_rt_put(rt); 278 fib6_info_release(rt);
278 err = -ENOMEM; 279 err = -ENOMEM;
279 goto out; 280 goto out;
280 } 281 }
@@ -330,7 +331,6 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr)
330 write_unlock_bh(&idev->lock); 331 write_unlock_bh(&idev->lock);
331 addrconf_leave_solict(idev, &aca->aca_addr); 332 addrconf_leave_solict(idev, &aca->aca_addr);
332 333
333 dst_hold(&aca->aca_rt->dst);
334 ip6_del_rt(dev_net(idev->dev), aca->aca_rt); 334 ip6_del_rt(dev_net(idev->dev), aca->aca_rt);
335 335
336 aca_put(aca); 336 aca_put(aca);
@@ -358,7 +358,6 @@ void ipv6_ac_destroy_dev(struct inet6_dev *idev)
358 358
359 addrconf_leave_solict(idev, &aca->aca_addr); 359 addrconf_leave_solict(idev, &aca->aca_addr);
360 360
361 dst_hold(&aca->aca_rt->dst);
362 ip6_del_rt(dev_net(idev->dev), aca->aca_rt); 361 ip6_del_rt(dev_net(idev->dev), aca->aca_rt);
363 362
364 aca_put(aca); 363 aca_put(aca);