8236184: (dc) IP_MULTICAST_* and IP_TOS socket options not effective

Reviewed-by: dfuchs
This commit is contained in:
Alan Bateman 2019-12-19 08:36:40 +00:00
parent 75cd193aac
commit 27e0cdf12d
5 changed files with 229 additions and 12 deletions

View file

@ -106,6 +106,16 @@ public class Net {
return exclusiveBind;
}
/**
* Tells whether both IPV6_XXX and IP_XXX socket options should be set on
* IPv6 sockets. On some kernels, both IPV6_XXX and IP_XXX socket options
* need to be set so that the settings are effective for IPv4 multicast
* datagrams sent using the socket.
*/
static boolean shouldSetBothIPv4AndIPv6Options() {
return shouldSetBothIPv4AndIPv6Options0();
}
/**
* Tells whether IPv6 sockets can join IPv4 multicast groups
*/
@ -438,6 +448,8 @@ public class Net {
*/
private static native int isExclusiveBindAvailable();
private static native boolean shouldSetBothIPv4AndIPv6Options0();
private static native boolean canIPv6SocketJoinIPv4Group0();
private static native boolean canJoin6WithIPv4Group0();