mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8293842: IPv6-only systems throws UnsupportedOperationException for several socket/TCP options
Co-authored-by: Martin Buchholz <martin@openjdk.org> Reviewed-by: djelinski, dfuchs
This commit is contained in:
parent
bb9aa4eae6
commit
9a40b76ac5
5 changed files with 25 additions and 9 deletions
|
@ -187,12 +187,16 @@ jint IPv6_supported()
|
|||
}
|
||||
#endif /* DONT_ENABLE_IPV6 */
|
||||
|
||||
jint reuseport_supported()
|
||||
jint reuseport_supported(int ipv6_available)
|
||||
{
|
||||
/* Do a simple dummy call, and try to figure out from that */
|
||||
int one = 1;
|
||||
int rv, s;
|
||||
s = socket(PF_INET, SOCK_STREAM, 0);
|
||||
if (ipv6_available) {
|
||||
s = socket(PF_INET6, SOCK_STREAM, 0);
|
||||
} else {
|
||||
s = socket(PF_INET, SOCK_STREAM, 0);
|
||||
}
|
||||
if (s < 0) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue