libgcj/3694: natPlainDatagramSocketImpl.cc doesn't compile in ALPHA OSF1
Rainer Orth
ro@TechFak.Uni-Bielefeld.DE
Fri Jul 27 06:16:00 GMT 2001
The following reply was made to PR libgcj/3694; it has been noted by GNATS.
From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
To: tromey@redhat.com
Cc: ake@purdue.edu, gcc-gnats@gcc.gnu.org, java-prs@gcc.gnu.org
Subject: Re: libgcj/3694: natPlainDatagramSocketImpl.cc doesn't compile in ALPHA OSF1
Date: Fri, 27 Jul 2001 15:09:03 +0200 (MEST)
Tom Tromey writes:
> >>>>> "Rainer" == ro <ro@gcc.gnu.org> writes:
>
> Rainer> I don't know what to do about the mreq6 problem, since I
> Rainer> don't have any V5.0/V5.0A machine. But I recall that while
> Rainer> IPv6 was first introduced in V5.1, V5.0 had some of the types etc.
> Rainer> mandated by the IPv6 extensions to the socket api.
>
> Is there some easy way we can detect this?
> If we can detect the problem in configure (preferably without
> referring to the host type) then we can simply disable IPv6.
I happend to have a V5.0 CD lying around, and found what's going on: while
<netinet/in.h> (really: <netinet/in6.h> has a definition of struct
sockaddr_in6 on V5.0 (although V5.1 was the first release to support IPv6
in the kernel, unless one used some IPv6 early access kit), which triggers
the definition of HAVE_INET6 by configure.in, it lacks any definition of
struct ipv6_mreq, which is protected by HAVE_INET6 in
java/net/natPlainDatagramSocketImpl.cc.
I think the obvious patch is to replace this by a test for
HAVE_STRUCT_IPV6_MREQ in configure.in and using the result instead. The
other instances of HAVE_INET6 only seem to use struct sockaddr_in6 and thus
should be save; it's probably best to leave them as is, to allow for either
the IPv6 EAK or running V5.0 binaries on V5.1 with IPv6 support enabled.
I'll post a patch together with a fix for the socklen_t/accept problem once
I've tested that part, but cannot check if the mreq6 problem is really
fixed since I don't run V5.0 here.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
More information about the Gcc-prs
mailing list