diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2001-07-18 20:39:52 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2001-07-18 20:39:52 +0000 |
commit | 06c271c3cf33d31e2002e5e03e5a93ff67b476cb (patch) | |
tree | 9fb36c4c999c24d7d2265d354cd76a6aaacddc8d /libjava/java | |
parent | 7ba0b0f7c67b4458839cf3d7ef3b6f8cbdee863a (diff) | |
download | gcc-06c271c3cf33d31e2002e5e03e5a93ff67b476cb.zip gcc-06c271c3cf33d31e2002e5e03e5a93ff67b476cb.tar.gz gcc-06c271c3cf33d31e2002e5e03e5a93ff67b476cb.tar.bz2 |
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
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/net/natPlainDatagramSocketImpl.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc index a90d2a8..4f6b319 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. |