if (addr instanceof Inet4Address) {
Inet4Address addr4 = (Inet4Address)addr;
ret[2] = r.newFixnum(AF_INET); //AF_INET
} else if (addr instanceof Inet6Address) {
Inet6Address addr6 = (Inet6Address)addr;
ret[2] = r.newFixnum(AF_INET6); //AF_INET
}
return r.newArrayNoCopy(ret);
} catch(UnknownHostException e) {
throw sockerr(context.getRuntime(), "gethostbyname: name or service not known");
}