From owner-svn-src-head@FreeBSD.ORG Thu Nov 12 15:21:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66EDD106566B; Thu, 12 Nov 2009 15:21:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3CDF08FC19; Thu, 12 Nov 2009 15:21:41 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E3FA646B2A; Thu, 12 Nov 2009 10:21:40 -0500 (EST) Date: Thu, 12 Nov 2009 15:21:40 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= In-Reply-To: <86hbsz24sq.fsf@ds4.des.no> Message-ID: References: <200911112130.nABLUw9b007768@svn.freebsd.org> <20091112135211.GT64905@hoeg.nl> <86hbsz24sq.fsf@ds4.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-128957440-1258039300=:11129" Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r199201 - in head: contrib/libpcap sbin/ifconfig share/man/man4 sys/kern sys/net sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2009 15:21:41 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-128957440-1258039300=:11129 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 12 Nov 2009, Dag-Erling Smørgrav wrote: >> So there used to be four chars in a row here (between if_description and >> if_cspare). Are you sure moving the pointer in between doesn't increase the >> structure size? > > I can guarantee you that it does. On i386, for instance, there are now > three bytes of implicit padding between if_alloctype and if_description, and > one more between if_cspare and if_pspare, so struct ifnet has grown by four > bytes. > > We should have CASSERTs for sizeof(struct ifnet) and other structs we really > care about. We care less about ifnet than we used to, because ifnet is now allocated by the kernel rather than drivers. However, if we want to take our KPI/KBI more seriously, then CTASSERTs on other "public" kernel structures might well be a good idea. On the other hand, CTASSERT errors on build are almost impervious to mortal comprehension (if you haven't seen them before, they make little sense to the reader), and will make it more difficult for people hacking on our kernel to do so casually. Some sort of other static checker might make more sense, and perhaps allow us to do more intelligent checking that just "total size" -- we'd also like to detect rearrangement of sensitive structs that would be size-preserving. Robert --621616949-128957440-1258039300=:11129--