Commit f708f528 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[NET]: Make neigh_parms setup/teardown handling symmetric.

parent f1e5cedd
......@@ -1114,9 +1114,6 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
if (*p == parms) {
*p = parms->next;
write_unlock_bh(&tbl->lock);
#ifdef CONFIG_SYSCTL
neigh_sysctl_unregister(parms);
#endif
kfree(parms);
return;
}
......@@ -1179,9 +1176,6 @@ int neigh_table_clear(struct neigh_table *tbl)
}
}
write_unlock(&neigh_tbl_lock);
#ifdef CONFIG_SYSCTL
neigh_sysctl_unregister(&tbl->parms);
#endif
return 0;
}
......
......@@ -197,7 +197,9 @@ static void inetdev_destroy(struct in_device *in_dev)
/* in_dev_put following below will kill the in_device */
write_unlock_bh(&inetdev_lock);
#ifdef CONFIG_SYSCTL
neigh_sysctl_unregister(in_dev->arp_parms);
#endif
neigh_parms_release(&arp_tbl, in_dev->arp_parms);
in_dev_put(in_dev);
}
......
......@@ -1893,10 +1893,11 @@ static int addrconf_ifdown(struct net_device *dev, int how)
/* Shot the device (if unregistered) */
if (how == 1) {
neigh_parms_release(&nd_tbl, idev->nd_parms);
#ifdef CONFIG_SYSCTL
addrconf_sysctl_unregister(&idev->cnf);
neigh_sysctl_unregister(&idev->nd_parms);
#endif
neigh_parms_release(&nd_tbl, idev->nd_parms);
in6_dev_put(idev);
}
return 0;
......
......@@ -1487,6 +1487,9 @@ int __init ndisc_init(struct net_proto_family *ops)
void ndisc_cleanup(void)
{
#ifdef CONFIG_SYSCTL
neigh_sysctl_unregister(&nd_tbl.parms);
#endif
neigh_table_clear(&nd_tbl);
sock_release(ndisc_socket);
ndisc_socket = NULL; /* For safety. */
......
......@@ -190,6 +190,7 @@ EXPORT_SYMBOL(neigh_app_ns);
#endif
#ifdef CONFIG_SYSCTL
EXPORT_SYMBOL(neigh_sysctl_register);
EXPORT_SYMBOL(neigh_sysctl_unregister);
#endif
EXPORT_SYMBOL(pneigh_lookup);
EXPORT_SYMBOL(pneigh_enqueue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment