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
This commit is contained in:
parent
7c8347536f
commit
879245b6b2
@ -1,3 +1,8 @@
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user