From owner-freebsd-current Sun Jul 14 13:56:24 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CEE937B400 for ; Sun, 14 Jul 2002 13:56:21 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id DD4D643E5E for ; Sun, 14 Jul 2002 13:56:18 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 2868 invoked by uid 0); 14 Jul 2002 20:56:12 -0000 Received: from pd953895d.dip.t-dialin.net (HELO forge.local) (217.83.137.93) by mail.gmx.net (mp020-rz3) with SMTP; 14 Jul 2002 20:56:12 -0000 Received: from tmm by forge.local with local (Exim 3.36 #1) id 17TqQH-0001dP-00; Sun, 14 Jul 2002 22:56:53 +0200 Date: Sun, 14 Jul 2002 22:56:53 +0200 From: Thomas Moestl To: Luigi Rizzo Cc: current@freebsd.org Subject: Re: different packing of structs in kernel vs. userland ? Message-ID: <20020714205653.GE314@crow.dom2ip.de> Mail-Followup-To: Luigi Rizzo , current@freebsd.org References: <20020714011810.A72236@iguana.icir.org> <20020714203642.GD314@crow.dom2ip.de> <20020714134337.A78891@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020714134337.A78891@iguana.icir.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 2002/07/14 at 13:43:37 -0700, Luigi Rizzo wrote: > [i am deliberately not trimming the email in case someone wants to > look at the context] > > i am a bit dubious about your explaination -- it also does not > explain why the person reporting this problem "fixed" that > by swapping "timestamp" and "next_rule" in the structure It does - doing so removes the need for padding before 'next_rule', because it is properly aligned then. 'timestamp' and 'cmd' are both 4 bytes in size and immediately follow each other, so the total structure size is a multiple of 8 (48 bytes). Because of that, no padding after 'cmd' is required, and the effect is gone. - thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message