Subject: Re: unaligned data object from SIOCGIFCONF
To: Jun-ichiro itojun Hagino <firstname.lastname@example.org>
From: Nathan J. Williams <nathanw@MIT.EDU>
Date: 02/20/2000 14:08:45
<email@example.com> (Jun-ichiro itojun Hagino) writes:
> With introduction of IPv6, SIOCGIFCONF can return unaligned data
> object for 64bit arch (like alpha). Situation is like this:
> - SIOCGIFCONF returns packed structs
> - sizeof(sockaddr_in6) % 8 != 0
> - so, data object from SIOCGIFCONF can be placed at "addr % 8
> != 0".
I notieced this problem when one of my alphas started spewing
alignment fixups for rarpd.
As you noted, this isn't new with IPv6, since some other sockaddr_foo
variants aren't multiples of 8.
I used solution 3 ("blame the application") for rarpd. The packing
of variable sized structures, while annoying, is the historic API, and
applications that make assumptions of alignment of structures packed
this way are broken.
> I think solution 3 is the right way ("broken userland programs should
> be bitten"), but if it bites too many userland programs, we may better
> pick solution 1. Thoughts? comments?
I agree with solution 3; I don't think the number of programs that use
SIOCGIFCONF is disasterously large. The lossage also isn't fatal.