8233435: (dc) DatagramChannel should allow IPv6 socket join IPv4 multicast groups (macOS, win)

Reviewed-by: dfuchs
This commit is contained in:
Alan Bateman 2019-11-09 11:48:37 +00:00
parent 690b960c8f
commit 090dc51a4e
6 changed files with 185 additions and 66 deletions

View file

@ -121,6 +121,14 @@ public class Net {
return canJoin6WithIPv4Group0();
}
/**
* Tells whether IPV6_XXX socket options should be used on an IPv6 socket
* that is bound to an IPv4 address.
*/
static boolean canUseIPv6OptionsWithIPv4LocalAddress() {
return canUseIPv6OptionsWithIPv4LocalAddress0();
}
public static InetSocketAddress checkAddress(SocketAddress sa) {
if (sa == null)
throw new NullPointerException();
@ -434,6 +442,8 @@ public class Net {
private static native boolean canJoin6WithIPv4Group0();
private static native boolean canUseIPv6OptionsWithIPv4LocalAddress0();
static FileDescriptor socket(boolean stream) throws IOException {
return socket(UNSPEC, stream);
}