Commit 879245b6 by Michael Koch Committed by Michael Koch

InetAddress.java (getCanonicalHostName): Support IPv6 addresses.

2004-11-17  Michael Koch  <konqueror@gmx.de>

	* java/net/InetAddress.java (getCanonicalHostName):
	Support IPv6 addresses.

From-SVN: r90793
parent 7c834753
2004-11-17 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java (getCanonicalHostName):
Support IPv6 addresses.
2004-11-16 Michael Koch <konqueror@gmx.de>
* java/lang/Object.java: Added javadocs all over (merged from GNU
......
......@@ -322,8 +322,14 @@ public class InetAddress implements Serializable
}
// Try to find the FDQN now
// FIXME: This does not work with IPv6.
InetAddress address = new Inet4Address(getAddress(), null);
InetAddress address;
byte[] ipaddr = getAddress();
if (ipaddr.length == 16)
address = new Inet6Address(getAddress(), null);
else
address = new Inet4Address(getAddress(), null);
return address.getHostName();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment