This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
3.0.1 PATCH: Allow java/net/natPlainDatagramSocketImpl.cc to compile on Tru64 UNIX V5.1
- To: java-patches at gcc dot gnu dot org
- Subject: 3.0.1 PATCH: Allow java/net/natPlainDatagramSocketImpl.cc to compile on Tru64 UNIX V5.1
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Fri, 13 Jul 2001 21:44:15 +0200 (MEST)
natPlainDatagramSocketImpl.cc failed to compile on Tru64 UNIX V5.1 since
<netinet/in6.h> didn't define the old RFC 2133 socket options IPV6_{ADD,
DROP}_MEMBERSHIP, while e.g. Solaris 8 kept them for backwards
compatibility. The following patch fixes this, allowing the file to
compile on either platform.
Ok for branch and mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Fri Jul 13 20:06:04 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* java/net/natPlainDatagramSocketImpl.cc (mcastGrp): Use new RFC
2533 socket options IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, falling
back to old RFC 2133 variants if missing.
===================================================================
RCS file: java/net/RCS/natPlainDatagramSocketImpl.cc,v
retrieving revision 1.1
diff -up -r1.1 java/net/natPlainDatagramSocketImpl.cc
--- java/net/natPlainDatagramSocketImpl.cc 2001/05/24 03:07:51 1.1
+++ java/net/natPlainDatagramSocketImpl.cc 2001/07/13 19:32:43
@@ -427,7 +427,16 @@ java::net::PlainDatagramSocketImpl::mcas
else if (len == 16)
{
level = IPPROTO_IPV6;
- opname = join ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP;
+
+ /* Prefer new RFC 2553 names. */
+#ifndef IPV6_JOIN_GROUP
+#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
+#endif
+#ifndef IPV6_LEAVE_GROUP
+#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
+#endif
+
+ opname = join ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP;
memcpy (&u.mreq6.ipv6mr_multiaddr, bytes, len);
// FIXME: If a non-default interface is set, use it; see Stevens p. 501.
// Maybe not, see note in last paragraph at bottom of Stevens p. 497.