Hi, On Sat, Aug 24, 2013 at 11:17:25AM +0000, Andre Oppermann wrote: > Author: andre > Date: Sat Aug 24 11:17:25 2013 > New Revision: 254773 > URL: http://svnweb.freebsd.org/changeset/base/254773 > > Log: > Resolve the confusion between the head_list and the hook list. > > The linked list of pfil hooks is changed to "chain" and this term > is applied consistently. The head_list remains with "list" term. > > Add KASSERT to vnet_pfil_uninit().
... > vnet_pfil_uninit(const void *unused) > { > > - /* XXX should panic if list is not empty */ > + KASSERT(LIST_EMPTY(&V_pfil_head_list), > + ("%s: pfil_head_list %p not empty", __func__, &V_pfil_head_list)); > PFIL_LOCK_DESTROY_REAL(&V_pfil_lock); > return (0); > } > It is triggered when destroying a vnet, due to inet/inet6 pfil hooks are not being unregistered. The attached patch fixes the issue for me. I am going to commit it if there are no objections -- might the unregistration has been skipped intentionally due to some unresolved issue? -- Mikolaj Golub
Unregister inet/inet6 pfil hooks on vnet destroy. Index: sys/netinet/ip_input.c =================================================================== --- sys/netinet/ip_input.c (revision 255362) +++ sys/netinet/ip_input.c (working copy) @@ -363,7 +363,12 @@ 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); Index: sys/netinet6/ip6_input.c =================================================================== --- sys/netinet6/ip6_input.c (revision 255362) +++ sys/netinet6/ip6_input.c (working copy) @@ -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);
_______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"