# HG changeset patch # User msheppar # Date 1388690607 0 # Node ID e613710a08a60680830cf67e56728dbd1890dbac # Parent 1c154d8a9a96c4fad0c1e9c5869f6c0729ebecea 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 diff -r 1c154d8a9a96 -r e613710a08a6 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 */