• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Based on net/ipv6/addrconf_core.c
4  * No Authors, no Copyright
5  *
6  * NewIP library code, needed by static components when full NewIP support is
7  * not configured or static.
8  */
9 #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__
10 
11 #include <net/nip.h>
12 #include <net/nip_addrconf.h>
13 #include <net/ip.h>
14 #include <linux/export.h>
15 #include "tcp_nip_parameter.h"
16 
nin_dev_finish_destroy_rcu(struct rcu_head * head)17 static void nin_dev_finish_destroy_rcu(struct rcu_head *head)
18 {
19 	struct ninet_dev *idev = container_of(head, struct ninet_dev, rcu);
20 
21 	kfree(idev);
22 }
23 
nin_dev_finish_destroy(struct ninet_dev * idev)24 void nin_dev_finish_destroy(struct ninet_dev *idev)
25 {
26 	struct net_device *dev = idev->dev;
27 
28 	WARN_ON(!list_empty(&idev->addr_list));
29 
30 	dev_put(dev);
31 	if (idev->dead)
32 		call_rcu(&idev->rcu, nin_dev_finish_destroy_rcu);
33 }
34 
35