From owner-cvs-all@FreeBSD.ORG Fri Jun 10 21:08:24 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C35A216A41C; Fri, 10 Jun 2005 21:08:24 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62DEA43D58; Fri, 10 Jun 2005 21:08:24 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.13.4/8.13.4) with ESMTP id j5AL8Nsq016955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Jun 2005 17:08:23 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id j5AL8IZA032270; Fri, 10 Jun 2005 17:08:18 -0400 (EDT) (envelope-from gallatin) Date: Fri, 10 Jun 2005 17:08:18 -0400 From: Andrew Gallatin To: Brooks Davis Message-ID: <20050610170818.A32249@grasshopper.cs.duke.edu> References: <200506101649.j5AGnOPu077043@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200506101649.j5AGnOPu077043@repoman.freebsd.org>; from brooks@FreeBSD.org on Fri, Jun 10, 2005 at 04:49:24PM +0000 X-Operating-System: FreeBSD 4.9-RELEASE-p1 on an i386 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 ifnet.9 src/sys/compat/ndis kern_ndis.c subr_ndis.c src/sys/contrib/altq/altq altq_rio.c src/sys/contrib/dev/oltr if_oltr.c if_oltr_pci.c if_oltrvar.h src/sys/contrib/pf/net if_pflog.c if_pflog.h if_pfsync.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 21:08:25 -0000 Brooks Davis [brooks@FreeBSD.org] wrote: > Stop embedding struct ifnet at the top of driver softcs. Instead the > struct ifnet or the layer 2 common structure it was embedded in have > been replaced with a struct ifnet pointer to be filled by a call to the > new function, if_alloc(). The layer 2 common structure is also allocated > via if_alloc() based on the interface type. It is hung off the new > struct ifnet member, if_l2com. > > This change removes the size of these structures from the kernel ABI and > will allow us to better manage them as interfaces come and go. What is the appropriate way to detach an interface now? I used to call just ether_ifdetach(ifp); Now I call both if_detach and if_free. Eg: ether_ifdetach(ifp); if_free(ifp); However, it looks like the ifp is getting leaked because I now see: myri0: if_free_type: value was not if_alloced, skipping I think this is because if_detatch() will remove the device from the global ifnet list, so the check in if_free() will always fail: if (ifp != ifnet_byindex(ifp->if_index)) Thanks, Drew