diff options
author | Cong Wang <amwang@redhat.com> | 2013-08-31 01:44:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-31 22:30:00 -0400 |
commit | f39dc1023d6b9933528638a0c2dd618b4fdf664e (patch) | |
tree | 827325cb95d1edf0e4b928c80539d5d962da556d /net/ipv6/addrconf.c | |
parent | e15a00aafa4b7953ad717d3cb1ad7acf4ff76945 (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.c | 30 |
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 | ||
307 | static 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 | |||
316 | void 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 | } | ||
335 | EXPORT_SYMBOL(in6_dev_finish_destroy); | ||
336 | |||
337 | static struct inet6_dev *ipv6_add_dev(struct net_device *dev) | 307 | static struct inet6_dev *ipv6_add_dev(struct net_device *dev) |
338 | { | 308 | { |
339 | struct inet6_dev *ndev; | 309 | struct inet6_dev *ndev; |