Subject: Porting netbsd networking code to alignment-strict processors
To: 'tech-net@netbsd.org' <tech-net@netbsd.org>
From: Randy Turner <rturner@2WIRE.com>
List: tech-net
Date: 06/17/1999 19:11:33
I was looking at the bsd4.4 networking code and it looks like that in some
cases, structures are mapped directly over the top of memory pointed to by
mbufs. It seems as if this would cause problems on CPU architectures that
are sensitive to alignment issues, due to the fact that a particular
longword (32-bit) item in a structure might fall onto an arbitrary byte
boundary if an arbitrary byte offset in an mbuf is cast to a structure
pointer.

It looks like the code handles endianness issues, but it seems fraught with
potential alignment issues. Can someone confirm this as a problem, or do I
need to go back and study the code more.

Thanks in advance!
Randy





Randy Turner
2Wire, Inc.
rturner@2wire.com