Unregister inet/inet6 pfil hooks on vnet destroy.

Discussed with:	andre
Approved by:	re (rodrigc)
This commit is contained in:
Mikolaj Golub 2013-09-13 18:45:10 +00:00
parent 377fc97958
commit 4d3dfd450a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255523
2 changed files with 9 additions and 0 deletions

View File

@ -363,6 +363,11 @@ ip_init(void)
void
ip_destroy(void)
{
int i;
if ((i = pfil_head_unregister(&V_inet_pfil_hook)) != 0)
printf("%s: WARNING: unable to unregister pfil hook, "
"error %d\n", __func__, i);
/* Cleanup in_ifaddr hash table; should be empty. */
hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask);

View File

@ -307,7 +307,11 @@ ip6proto_unregister(short ip6proto)
void
ip6_destroy()
{
int i;
if ((i = pfil_head_unregister(&V_inet6_pfil_hook)) != 0)
printf("%s: WARNING: unable to unregister pfil hook, "
"error %d\n", __func__, i);
hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask);
nd6_destroy();
callout_drain(&V_in6_tmpaddrtimer_ch);