From 06c271c3cf33d31e2002e5e03e5a93ff67b476cb Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Wed, 18 Jul 2001 20:39:52 +0000 Subject: [PATCH] natPlainDatagramSocketImpl.cc (mcastGrp): Use new RFC 2533 socket options IPV6_JOIN_GROUP... * 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. From-SVN: r44130 --- libjava/ChangeLog | 6 ++++++ libjava/java/net/natPlainDatagramSocketImpl.cc | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 3756cc2447f..914f698aca0 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2001-07-18 Rainer Orth + + * 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. + 2001-07-18 Tom Tromey * java/io/natFileWin32.cc (_access): Renamed. diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc index a90d2a8e8e0..4f6b3194c46 100644 --- a/libjava/java/net/natPlainDatagramSocketImpl.cc +++ b/libjava/java/net/natPlainDatagramSocketImpl.cc @@ -415,7 +415,16 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr, 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. -- 2.30.2