8027903: java/net/MulticastSocket/SetGetNetworkInterfaceTest.java throws java.net.SocketException: Cannot assign requested address
authormsheppar
Thu, 02 Jan 2014 19:23:27 +0000
changeset 22095 e613710a08a6
parent 22094 1c154d8a9a96
child 22097 49bc688ee68b
8027903: java/net/MulticastSocket/SetGetNetworkInterfaceTest.java throws java.net.SocketException: Cannot assign requested address Summary: check for pending Exception and clear if invoking ipv6 mcast_set_xxx function during setNetworkInterface call flow. Reviewed-by: alanb, chegar
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Mon Dec 30 16:34:06 2013 +0400
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Thu Jan 02 19:23:27 2014 +0000
@@ -1202,6 +1202,9 @@
 #ifdef __linux__
         mcast_set_if_by_addr_v4(env, this, fd, value);
         if (ipv6_available()) {
+            if ((*env)->ExceptionCheck(env)){
+                (*env)->ExceptionClear(env);
+            }
             mcast_set_if_by_addr_v6(env, this, fd, value);
         }
 #else  /* __linux__ not defined */
@@ -1224,6 +1227,9 @@
 #ifdef __linux__
         mcast_set_if_by_if_v4(env, this, fd, value);
         if (ipv6_available()) {
+            if ((*env)->ExceptionCheck(env)){
+                (*env)->ExceptionClear(env);
+            }
             mcast_set_if_by_if_v6(env, this, fd, value);
         }
 #else  /* __linux__ not defined */
@@ -1297,6 +1303,9 @@
 #ifdef __linux__
     mcast_set_loop_v4(env, this, fd, value);
     if (ipv6_available()) {
+        if ((*env)->ExceptionCheck(env)){
+            (*env)->ExceptionClear(env);
+        }
         mcast_set_loop_v6(env, this, fd, value);
     }
 #else  /* __linux__ not defined */