[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/36974 (xorp doesn't compile targeted at arm)
The following reply was made to PR pkg/36974; it has been noted by GNATS.
From: Ignatios Souvatzis <is%netbsd.org@localhost>
Cc: pkg-manager%netbsd.org@localhost, pkgsrc-bugs%netbsd.org@localhost,
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Mon, 18 May 2009 06:54:36 +0200
On Tue, May 12, 2009 at 02:02:33PM +0000, obache%NetBSD.org@localhost wrote:
> Synopsis: xorp doesn't compile targeted at arm
> State-Changed-From-To: open->feedback
> State-Changed-By: obache%NetBSD.org@localhost
> State-Changed-When: Tue, 12 May 2009 14:02:32 +0000
> Updated to 1.6. Would you try to build the version?
Same as 1.5:
cc1plus: warnings being treated as errors
ipvx.cc: In member function 'size_t IPvX::copy_out(sockaddr_in&) const':
ipvx.cc:370: warning: cast from 'sockaddr_in*' to 'sockaddr_in6*' increases
ired alignment of target type
ipvx.cc: In member function 'size_t IPvX::copy_in(const sockaddr_in&)':
ipvx.cc:501: warning: cast from 'const sockaddr_in*' to 'const sockaddr_in6*'
creases required alignment of target type
gmake: *** [ipvx.lo] Error 1
OK, I was brave and looked at the code.
What they do is simply wrong... IPv6 cases bolted on IPv4-code as an
afterthought. So they assume they could add a few AF_INET6 cases even
when sockaddr_in is used, in case parts of the code are still wrong.
Only this doesn't work, because of different size in addition to
different alignment restrictions.
They should have used struct sockaddr in the old days, with casting
it to sockaddr_in where necessary; then they could have globally
s/struct sockaddr/struct sockaddr_storage/ for the modern days.
Lukem@ pointed out, that in Stevens, Unix Network Programming, Volume 1
page 72/73 all this stuff is explained (e.g. fig 3.6).
<lukem> `` If any socket address structures that the systems upports have
+alignment requirements, the sockaddr_storage proivides the strictest
+alignment requirement. ''
Main Index |
Thread Index |