From owner-cvs-all@FreeBSD.ORG Thu Jul 27 15:22:23 2006 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 87EF416A4DF; Thu, 27 Jul 2006 15:22:23 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81BE443D55; Thu, 27 Jul 2006 15:22:14 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k6RFMCUH092899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Jul 2006 08:22:13 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <44C8DA23.5000406@errno.com> Date: Thu, 27 Jul 2006 08:22:11 -0700 From: Sam Leffler User-Agent: Thunderbird 1.5.0.4 (X11/20060724) MIME-Version: 1.0 To: Robert Watson References: <200607260330.k6Q3UooP047077@repoman.freebsd.org> <20060727124542.V4612@fledge.watson.org> In-Reply-To: <20060727124542.V4612@fledge.watson.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb if_ural.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: Thu, 27 Jul 2006 15:22:23 -0000 Robert Watson wrote: > > On Wed, 26 Jul 2006, Sam Leffler wrote: > >> sam 2006-07-26 03:30:50 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/dev/usb if_ural.c >> Log: >> support for 802.11 packet injection via bpf >> >> Reviewed by: arch@ >> MFC after: 1 month > > --------------------------------------- > @@ -209,6 +211,9 @@ > */ > if (ic->ic_reset == NULL) > ic->ic_reset = ieee80211_default_reset; > + > + KASSERT(ifp->if_spare2 == NULL, ("oops, hosed")); > + ifp->if_spare2 = ic; /* XXX temp backpointer */ > } > --------------------------------------- > > Please don't use spare pointers without properly allocating them (i.e., > renaming them). I ran into this this morning when merging these changes > into the rwatson_ifnet branch, where if_spare2 was renamed to > if_startmbuf. However, if the above change is MFC'd as is, people may > well find the problem through run-time corruption when the network stack > tries to execute the ic contents thinking that it's a non-NULL > if_startmbuf function pointer, which is a lot harder to debug. The > point of spare fields is that they be spare -- if they are no longer > spare, they should not be left marked as spare, or they will get reused > with unfortunate ABI consequences. I don't mind if this spare is > allocated (if_softc2, if_driver, or the like), as we have one more spare > pointer I can use in 6.x, but the current use of the spare field is > problematic and should not be MFC'd unless cleaned up. This was intended as a stopgap until the vap changes were in place and will never be mfc'd. I understand about reuse; hence the assertion. Since you renamed the field didn't code just stop compiling? I assumed these were going to be treated like the M_PROTOx flags in mbuf.h that are kinda spare but used within layers for their own purpose. Sam