changeset 6944:13473046fdfe

7084032: test/java/net/Inet6Address/B6558853.java fails on Windows XP/2003 if IPv6 Reviewed-by: chegar
author robm
date Tue, 11 Feb 2014 16:06:59 +0000
parents 8e2b4808a068
children 3edb49b50486
files src/windows/native/java/net/TwoStacksPlainSocketImpl.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Fri Feb 07 16:00:49 2014 +0400
+++ b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Tue Feb 11 16:06:59 2014 +0000
@@ -576,6 +576,7 @@
 {
     /* fields on this */
     jint port;
+    jint scope;
     jint timeout = (*env)->GetIntField(env, this, psi_timeoutID);
     jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
     jobject fd1Obj = (*env)->GetObjectField(env, this, psi_fd1ID);
@@ -751,9 +752,12 @@
             return;
         }
         setInet6Address_ipaddress(env, socketAddressObj, (const char *)&him.him6.sin6_addr);
-
         setInetAddress_family(env, socketAddressObj, IPv6);
-        setInet6Address_scopeid(env, socketAddressObj, him.him6.sin6_scope_id);
+        scope = him.him6.sin6_scope_id;
+        (*env)->SetIntField(env, socketAddressObj, ia6_scopeidID, scope);
+        if(scope>0) {
+            (*env)->SetBooleanField(env, socketAddressObj, ia6_scopeidsetID, JNI_TRUE);
+        }
     }
     /* fields common to AF_INET and AF_INET6 */