From owner-svn-src-head@FreeBSD.ORG Tue Aug 10 20:28:57 2010 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 C8DD51065674 for ; Tue, 10 Aug 2010 20:28:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 877148FC25 for ; Tue, 10 Aug 2010 20:28:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7AKJQG4078413; Tue, 10 Aug 2010 14:19:26 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 10 Aug 2010 14:19:58 -0600 (MDT) Message-Id: <20100810.141958.923962171922746057.imp@bsdimp.com> To: olli@fromme.com From: "M. Warner Losh" In-Reply-To: <201008101956.o7AJu5ms044774@haluter.fromme.com> References: <20100810.120103.69891821625677670.imp@bsdimp.com> <201008101956.o7AJu5ms044774@haluter.fromme.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, jilles@stack.nl, svn-src-all@FreeBSD.org, olli@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: svn commit: r211023 - head/usr.sbin/syslogd 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: Tue, 10 Aug 2010 20:28:57 -0000 In message: <201008101956.o7AJu5ms044774@haluter.fromme.com> Oliver Fromme writes: : : M. Warner Losh wrote: : > /* : > * Macros to cast a struct sockaddr, or parts thereof. struct : > * sockaddr's alginment is loose to later be cast to a sockaddr_in or : > * sockaddr_in6. On architectures with strict alignment requirements, : > * this leads to compiler warnings because the compiler doesn't know : > * the ABI guarantees proper alignment. : > */ : > : > But this leads me to think that the right fix might be: : > : > /* : > * Structure used by kernel to store most : > * addresses. : > */ : > struct sockaddr { : > unsigned char sa_len; /* total length */ : > sa_family_t sa_family; /* address family */ : > char sa_data[14]; /* actually longer; address value */ : > } __aligned(4); : > : > since that's what the ABI defines.... : : Yes, that would solve most of the problems, at least the ones : related to struct sockaddr. : : Can we make that change to struct sockaddr, or does it cause : unwanted side-effects? : : I could do a full "make universe" to test it, but it would : probably take two days on my 9-current machine. Just do it on MIPS. You'll find that a number of structures are potentially already allocated with less than required alignment. There's about a dozen places in the tree that would start to fail if we did this, or the stronger form of __aligned(8). We could add that to the other structures, but then we're breaking ABI rules, I think. Warner