Subject: Re: CMSG_* problems
To: None <tech-userlevel@NetBSD.org, tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 02/11/2007 23:42:12
> I can assure you that the author's [of RFC2292] assumed the buffer
> used for control messages would be properly aligned for deferencing
> cmsghdr structures and/or any other structure in buffer.
Which is exactly the problem I propose to fix - or, since that
interface is cast in stone by now, I propose to work around by
providing an interface permitting applications to process control
message buffers *withotu* making such assumptions.
It's ugly and fragile to assume such a thing, especially when it is not
documented anywhere (as far as I can see). Worse, one of the most
popular architectures (i386) silently patches up unaligned accesses,
leading app authors to assume their code is fine, only to get a nasty
surprise upon trying to run it on something like a SPARC which gets
upset over misaligned accesses.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML firstname.lastname@example.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B