From owner-svn-src-all@FreeBSD.ORG Thu Nov 12 16:10:07 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141B9106566C for ; Thu, 12 Nov 2009 16:10:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 9E95C8FC14 for ; Thu, 12 Nov 2009 16:10:06 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nACG8oQa065496; Thu, 12 Nov 2009 10:08:50 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nACG8nuU065495; Thu, 12 Nov 2009 10:08:49 -0600 (CST) (envelope-from brooks) Date: Thu, 12 Nov 2009 10:08:49 -0600 From: Brooks Davis To: Robert Watson Message-ID: <20091112160849.GB65026@lor.one-eyed-alien.net> References: <200911112130.nABLUw9b007768@svn.freebsd.org> <20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 12 Nov 2009 10:08:51 -0600 (CST) Cc: Ed Schouten , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Xin LI , svn-src-head@FreeBSD.org, Dag-Erling Sm?rgrav Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig share/man/man4 sys/kern sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 12 Nov 2009 16:10:07 -0000 --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 12, 2009 at 03:21:40PM +0000, Robert Watson wrote: >=20 > On Thu, 12 Nov 2009, Dag-Erling Sm??rgrav wrote: >=20 >>> So there used to be four chars in a row here (between if_description an= d=20 >>> if_cspare). Are you sure moving the pointer in between doesn't increase= =20 >>> the structure size? >>=20 >> I can guarantee you that it does. On i386, for instance, there are now= =20 >> three bytes of implicit padding between if_alloctype and if_description,= =20 >> and one more between if_cspare and if_pspare, so struct ifnet has grown = by=20 >> four bytes. >>=20 >> We should have CASSERTs for sizeof(struct ifnet) and other structs we=20 >> really care about. >=20 > We care less about ifnet than we used to, because ifnet is now allocated = by=20 > the kernel rather than drivers. However, if we want to take our KPI/KBI= =20 > more seriously, then CTASSERTs on other "public" kernel structures might= =20 > well be a good idea. On the other hand, CTASSERT errors on build are=20 > almost impervious to mortal comprehension (if you haven't seen them befor= e,=20 > they make little sense to the reader), and will make it more difficult fo= r=20 > people hacking on our kernel to do so casually. Some sort of other stati= c=20 > checker might make more sense, and perhaps allow us to do more intelligen= t=20 > checking that just "total size" -- we'd also like to detect rearrangement= =20 > of sensitive structs that would be size-preserving. In this specific case, we should remove all the spare pointers since they don't really add value. The only rule should be that when you MFC you have to add to the end rather than inserting in the strictly logical location. -- Brooks --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFK/DMRXY6L6fI4GtQRAuGsAJ9e65J9g3HLfajdU56nCRlRNU1kNQCfZACW 8K9lsTimLCfdrl3mG7N+x6A= =QQT0 -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM--