changeset 13181:b016b7d4e84e

8196224: Even better Internet address support Reviewed-by: chegar, rriggs, rhalade, vtewari
author igerasim
date Mon, 05 Feb 2018 15:20:13 -0800
parents b4c6d8f2cf1b
children 585b04ddf50c
files src/solaris/native/java/net/PlainDatagramSocketImpl.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Mon Feb 05 04:31:19 2018 -0800
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Mon Feb 05 15:20:13 2018 -0800
@@ -1081,6 +1081,7 @@
     struct in_addr in;
     jobjectArray addrArray;
     jsize len;
+    jint family;
     jobject addr;
     int i;
 
@@ -1110,7 +1111,9 @@
      */
     for (i = 0; i < len; i++) {
         addr = (*env)->GetObjectArrayElement(env, addrArray, i);
-        if (getInetAddress_family(env, addr) == IPv4) {
+        family = getInetAddress_family(env, addr);
+        JNU_CHECK_EXCEPTION(env);
+        if (family == IPv4) {
             JNU_CHECK_EXCEPTION(env);
             in.s_addr = htonl(getInetAddress_addr(env, addr));
             JNU_CHECK_EXCEPTION(env);
@@ -1975,6 +1978,7 @@
 
     jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID);
     jint fd;
+    jint family;
     jint ipv6_join_leave;
 
     if (IS_NULL(fdObj)) {
@@ -1996,7 +2000,9 @@
     ipv6_join_leave = ipv6_available();
 
 #ifdef __linux__
-    if (getInetAddress_family(env, iaObj) == IPv4) {
+    family = getInetAddress_family(env, iaObj);
+    JNU_CHECK_EXCEPTION(env);
+    if (family == IPv4) {
         JNU_CHECK_EXCEPTION(env);
         ipv6_join_leave = JNI_FALSE;
     }