diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c index cf0888875..6ebb64fa5 100644 --- a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c +++ b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c @@ -572,14 +572,10 @@ Java_gnu_java_net_VMPlainSocketImpl_joinGroup (JNIEnv *env, #ifdef HAVE_SETSOCKOPT struct ip_mreq maddr; jbyte *addr_elems; - const char *str_ifname; if (ifname != NULL) { - str_ifname = JCL_jstring_to_cstring(env, ifname); - maddr.imr_interface.s_addr = getif_address (env, str_ifname); - JCL_free_cstring(env, ifname, str_ifname); - + maddr.imr_interface.s_addr = getif_address (env, ifname); if ((*env)->ExceptionCheck (env)) return; } @@ -597,7 +593,6 @@ Java_gnu_java_net_VMPlainSocketImpl_joinGroup (JNIEnv *env, if (-1 == setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &maddr, sizeof (struct ip_mreq))) JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno)); - #else (void) fd; (void) addr; @@ -622,14 +617,10 @@ Java_gnu_java_net_VMPlainSocketImpl_joinGroup6 (JNIEnv *env, #ifdef HAVE_INET6 struct ipv6_mreq maddr; jbyte *addr_elems; - char *str_ifname; if (ifname == NULL) { - str_ifname = JCL_jstring_to_cstring(env, ifname); - maddr.ipv6mr_interface = getif_index (env, str_ifname); - JCL_free_cstring(env, ifname, str_ifname); - + maddr.ipv6mr_interface = getif_index (env, ifname); if ((*env)->ExceptionCheck (env)) return; } @@ -675,14 +666,10 @@ Java_gnu_java_net_VMPlainSocketImpl_leaveGroup (JNIEnv *env, #ifdef HAVE_SETSOCKOPT struct ip_mreq maddr; jbyte *addr_elems; - char *str_ifname; if (ifname != NULL) { - str_ifname = JCL_jstring_to_cstring(env, ifname); - maddr.imr_interface.s_addr = getif_address (env, str_ifname); - JCL_free_cstring(env, ifname, str_ifname); - + maddr.imr_interface.s_addr = getif_address (env, ifname); if ((*env)->ExceptionCheck (env)) return; } @@ -724,14 +711,10 @@ Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6 (JNIEnv *env, #ifdef HAVE_INET6 struct ipv6_mreq maddr; jbyte *addr_elems; - char *str_ifname; if (ifname == NULL) { - str_ifname = JCL_jstring_to_cstring(env, ifname); - maddr.ipv6mr_interface = getif_index (env, str_ifname); - JCL_free_cstring(env, ifname, str_ifname); - + maddr.ipv6mr_interface = getif_index (env, ifname); if ((*env)->ExceptionCheck (env)) return; } |