8199110: Address Internet Addresses

Reviewed-by: chegar, rriggs, igerasim, skoivu, rhalade
This commit is contained in:
Vyom Tewari 2018-03-30 08:37:31 +05:30
parent 02876bfceb
commit 627e310ba5
3 changed files with 31 additions and 8 deletions

View file

@ -331,9 +331,16 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0
netif *ifs, *curr;
jobject obj = NULL;
jboolean match = JNI_FALSE;
int family = (getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4) ?
AF_INET : AF_INET6;
int family = getInetAddress_family(env, iaObj);
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
if (family == java_net_InetAddress_IPv4) {
family = AF_INET;
} else if (family == java_net_InetAddress_IPv6) {
family = AF_INET6;
} else {
return NULL; // Invalid family
}
ifs = enumInterfaces(env);
if (ifs == NULL) {
return NULL;