aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-08-31 01:44:35 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-31 22:30:00 -0400
commitf39dc1023d6b9933528638a0c2dd618b4fdf664e (patch)
tree827325cb95d1edf0e4b928c80539d5d962da556d /net/ipv6/addrconf.c
parente15a00aafa4b7953ad717d3cb1ad7acf4ff76945 (diff)
ipv6: move in6_dev_finish_destroy() into core kernel
in6_dev_put() will be needed by vxlan module, so is in6_dev_finish_destroy(). Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index baaaead69ee1..2a66eaad047f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -304,36 +304,6 @@ err_ip:
304 return -ENOMEM; 304 return -ENOMEM;
305} 305}
306 306
307static void snmp6_free_dev(struct inet6_dev *idev)
308{
309 kfree(idev->stats.icmpv6msgdev);
310 kfree(idev->stats.icmpv6dev);
311 snmp_mib_free((void __percpu **)idev->stats.ipv6);
312}
313
314/* Nobody refers to this device, we may destroy it. */
315
316void in6_dev_finish_destroy(struct inet6_dev *idev)
317{
318 struct net_device *dev = idev->dev;
319
320 WARN_ON(!list_empty(&idev->addr_list));
321 WARN_ON(idev->mc_list != NULL);
322 WARN_ON(timer_pending(&idev->rs_timer));
323
324#ifdef NET_REFCNT_DEBUG
325 pr_debug("%s: %s\n", __func__, dev ? dev->name : "NIL");
326#endif
327 dev_put(dev);
328 if (!idev->dead) {
329 pr_warn("Freeing alive inet6 device %p\n", idev);
330 return;
331 }
332 snmp6_free_dev(idev);
333 kfree_rcu(idev, rcu);
334}
335EXPORT_SYMBOL(in6_dev_finish_destroy);
336
337static struct inet6_dev *ipv6_add_dev(struct net_device *dev) 307static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
338{ 308{
339 struct inet6_dev *ndev; 309 struct inet6_dev *ndev;