Subject: Re: CVS commit: syssrc
To: Jun-ichiro itojun Hagino <itojun@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-net
Date: 05/15/2000 10:02:39
On Mon, May 15, 2000 at 09:45:51AM -0700, Jun-ichiro itojun Hagino wrote:

 > 
 > Module Name:	syssrc
 > Committed By:	itojun
 > Date:		Mon May 15 16:45:51 UTC 2000
 > 
 > Modified Files:
 > 	syssrc/sys/net: if.h
 > 
 > Log Message:
 > add packed attribute to struct ifreq.  this should avoid unaligned access
 > while parsing SIOCGIFCONF, on alignment-picky archs.

This is wrong!  It could change the ABI for this structure!  Please back
it out!

I know there is an issue with unaligned accesses and struct ifreq, and it
is due to a complicated compiler issue and the GCC people's interpretation
of the ISO C standard.  I went over this issue with them on gcc-bugs
regarding some other code where this happened with the inlining of a
memcpy() call, and there is a potential solution that actually involves
"fixing" the compiler[*].

[*] Technically, the compiler isn't broken in its optimization of the
memcpy() call -- I will dig though my mail archives and quote the relevant
parts of the dicussion I had with the GCC people.  However, GCC should
pay attention to typecasts in the arguments, as the Tru64 C compiler does,
so as to avoid the problem that way.

In the mean time, PLEASE BACK OUT THE ifreq CHANGE!

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>