mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8211842: IPv6_supported wrongly returns false when unix domain socket is bound to fd 0
Reviewed-by: chegar, alanb
This commit is contained in:
parent
10d83827bc
commit
4a77a08ca3
7 changed files with 234 additions and 5 deletions
|
@ -305,12 +305,12 @@ jint IPv6_supported()
|
|||
}
|
||||
|
||||
/*
|
||||
* If fd 0 is a socket it means we've been launched from inetd or
|
||||
* If fd 0 is a socket it means we may have been launched from inetd or
|
||||
* xinetd. If it's a socket then check the family - if it's an
|
||||
* IPv4 socket then we need to disable IPv6.
|
||||
*/
|
||||
if (getsockname(0, &sa.sa, &sa_len) == 0) {
|
||||
if (sa.sa.sa_family != AF_INET6) {
|
||||
if (sa.sa.sa_family == AF_INET) {
|
||||
close(fd);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue