mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8236184: (dc) IP_MULTICAST_* and IP_TOS socket options not effective
Reviewed-by: dfuchs
This commit is contained in:
parent
75cd193aac
commit
27e0cdf12d
5 changed files with 229 additions and 12 deletions
|
@ -155,6 +155,18 @@ Java_sun_nio_ch_Net_isExclusiveBindAvailable(JNIEnv *env, jclass clazz) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_nio_ch_Net_shouldSetBothIPv4AndIPv6Options0(JNIEnv* env, jclass cl)
|
||||
{
|
||||
#if defined(__linux__)
|
||||
/* Set both IPv4 and IPv6 socket options when setting multicast options */
|
||||
return JNI_TRUE;
|
||||
#else
|
||||
/* Do not set both IPv4 and IPv6 socket options when setting multicast options */
|
||||
return JNI_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl)
|
||||
{
|
||||
|
@ -540,12 +552,6 @@ Java_sun_nio_ch_Net_setIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
|
|||
JNU_JAVANETPKG "SocketException",
|
||||
"sun.nio.ch.Net.setIntOption");
|
||||
}
|
||||
#ifdef __linux__
|
||||
if (level == IPPROTO_IPV6 && opt == IPV6_TCLASS && isIPv6) {
|
||||
// set the V4 option also
|
||||
setsockopt(fdval(env, fdo), IPPROTO_IP, IP_TOS, parg, arglen);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue