From owner-svn-src-all@FreeBSD.ORG Sat Sep 7 15:30:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E4E04CF; Sat, 7 Sep 2013 15:30:37 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-x22e.google.com (mail-ea0-x22e.google.com [IPv6:2a00:1450:4013:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A872226BF; Sat, 7 Sep 2013 15:30:35 +0000 (UTC) Received: by mail-ea0-f174.google.com with SMTP id z15so2214036ead.33 for ; Sat, 07 Sep 2013 08:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=51Z6wdVrGIoA0K1KRCupuRGNxTV3NLQgDWsor2KWhkQ=; b=ydnuukKtGe9zBGj9vvEizbh0kQCuQAwubLFH2mGkxgRPqewCOBeJhOx91/G4ApuxCF TLtYjp4QPPrCii2b926apn6gE/5F62tDCxY8RrAbNsbpWSF3Q6OPGoT/YxdwkFnG9DaV 0Rgbp/LmS4Ji9Y2bOprArAXqv9VLwhsKJwM+ioK2S7+dms2+qNqaSfwnoElx/pPqIaGa FAftZeAzqMm8ndpptSSquLuJaZuwi6ZpLq3gWI2Aakg7CAc/35ejixkq96XDIFyvas/n Aup2v829qzR7bm69g9Igr2pEXcvWkoMoWBnF6MLHJfCBdPElr9v+vOVQEp9hRQcHrKa/ NzqA== X-Received: by 10.14.199.3 with SMTP id w3mr13879032een.33.1378567834045; Sat, 07 Sep 2013 08:30:34 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id p5sm5900299eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Sep 2013 08:30:33 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 7 Sep 2013 18:30:31 +0300 From: Mikolaj Golub To: Andre Oppermann Subject: Re: svn commit: r254773 - head/sys/net Message-ID: <20130907153029.GB7349@gmail.com> References: <201308241117.r7OBHPQ1032341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LyciRD1jyfeSSjG0" Content-Disposition: inline In-Reply-To: <201308241117.r7OBHPQ1032341@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, zec@freebsd.org, bz@freebsd.org, svn-src-head@freebsd.org, julian@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Sep 2013 15:30:37 -0000 --LyciRD1jyfeSSjG0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --LyciRD1jyfeSSjG0 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="ip_input.pfil_head_unregister.1.patch" 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); --LyciRD1jyfeSSjG0--