Several potential fixes have been identified for the linux/unix native coding of Inet4AddressImpl and Inet6AddressImpl. Besides some formatting cleanup in the source code, these are the most significant changes:
Java_java_net_Inet4AddressImpl_lookupAllHostAddr:
Java_java_net_Inet6AddressImpl_lookupAllHostAddr:
- remove isspace(hostname[0]) check for Solaris. It should check if the hostname starts with a blank and throw an UnknownHostException in that case. However, testing on current Solaris shows that it is not needed and the UnknownHostException is thrown anyway.
Java_java_net_Inet4AddressImpl_getHostByAddr:
Java_java_net_Inet6AddressImpl_getHostByAddr:
- replace CHECK_NULL_RETURN(ret, NULL) with throwing UnknownHostException in case of NULL return by NewStringUTF. This seems more correct if you look at the usage of getHostByAddr in InetAddress.java
Java_java_net_Inet4AddressImpl_isReachable0:
Java_java_net_Inet6AddressImpl_isReachable0:
- moved tcp_ping code to static function, just as in the Windows implementation
- cleanups to consistently use SOCKETADDRESS struct
Java_java_net_Inet4AddressImpl_lookupAllHostAddr:
Java_java_net_Inet6AddressImpl_lookupAllHostAddr:
- remove isspace(hostname[0]) check for Solaris. It should check if the hostname starts with a blank and throw an UnknownHostException in that case. However, testing on current Solaris shows that it is not needed and the UnknownHostException is thrown anyway.
Java_java_net_Inet4AddressImpl_getHostByAddr:
Java_java_net_Inet6AddressImpl_getHostByAddr:
- replace CHECK_NULL_RETURN(ret, NULL) with throwing UnknownHostException in case of NULL return by NewStringUTF. This seems more correct if you look at the usage of getHostByAddr in InetAddress.java
Java_java_net_Inet4AddressImpl_isReachable0:
Java_java_net_Inet6AddressImpl_isReachable0:
- moved tcp_ping code to static function, just as in the Windows implementation
- cleanups to consistently use SOCKETADDRESS struct