I recently studied why a browser on Android does not support access to IPv6 websites through IPv6 URLs and I think this is due to the native getaddrinfo method called android/dalvik/libcore/luni/src/main/java/java/net/ InetAddress.java , which is then called by the Browser application, throws a UnknownHostException when trying to convert an IPv6 URL to its addresses.
Start at line 507, InetAddress.java code:
try { InetAddress[] addresses = bytesToInetAddresses(getaddrinfo(host), host); addressCache.put(host, addresses); return addresses;
and the native method is declared on line 516 as follows:
private static native byte[][] getaddrinfo(String name) throws UnknownHostException;
But I did not find any hint where the implementation of this native method getaddrinfo is - although I found two files called getaddrinfo.c . Does this mean JNI or NDK rules? If therefore the statement System.loadLibary("NameOfTheLibrary") should be, but I did not find it. Anyone could give me a hint about finding an implementation of this own getaddrinfo method?
The full InetAddress.java source file can be found at http://ooowjc.wikispaces.com/Attachments
source share