mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8200719: Cannot connect to IPv6 host when exists any active network interface without IPv6 address
Reviewed-by: clanger, chegar
This commit is contained in:
parent
d574c9e091
commit
4f1c8f3d08
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ void setDefaultScopeID(JNIEnv *env, struct sockaddr *him)
|
|||
}
|
||||
int defaultIndex;
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)him;
|
||||
if (sin6->sin6_family == AF_INET6 && (sin6->sin6_scope_id == 0)) {
|
||||
if (sin6->sin6_family == AF_INET6 && (sin6->sin6_scope_id == 0) &&
|
||||
(IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) ||
|
||||
IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))) {
|
||||
defaultIndex = (*env)->GetStaticIntField(env, ni_class,
|
||||
ni_defaultIndexID);
|
||||
sin6->sin6_scope_id = defaultIndex;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue