On Linux RH 6.2(Kernel version 2.4.3) with build 62 InetAddress is accepting some wrong IPv6 addresses. For same address on Sol8/IASol8 its throwing UnknownHostException.
Using following three addresses you can test this..
ffe0:BAD:2:33:0040:5555:6666:7:
ffe0::BAD:
ffe0::BAD:2:33:0040:5555:6666:7
How to reproduce:
1 Take the attached GetIP.java
2. Test with above addresses.
I have pasted the output:
on Solaris 8:
---------------
java GetIP ffe0:BAD:2:33:0040:5555:6666:7:
exp mesg ffe0:BAD:2:33:0040:5555:6666:7:
java.net.UnknownHostException: ffe0:BAD:2:33:0040:5555:6666:7:
at java.net.InetAddress.getAllByName0(InetAddress.java:778)
at java.net.InetAddress.getAllByName0(InetAddress.java:748)
at java.net.InetAddress.getAllByName(InetAddress.java:742)
at GetIP.main(GetIP.java:11)
on Linux RH6.2:
----------------
java GetIP ffe0:BAD:2:33:0040:5555:6666:7:
iadr length 1
host name ffe0:BAD:2:33:0040:5555:6666:7:
AFter getting iadr
AFter getting niface
network interface null
ip address : [ffe0:bad:2:33:40:5555:6666:7]
Host Name :ffe0:BAD:2:33:0040:5555:6666:7:
Host aadd byte arr [B@5ff48b
v6 address
NOt org local scope
working....
Using following three addresses you can test this..
ffe0:BAD:2:33:0040:5555:6666:7:
ffe0::BAD:
ffe0::BAD:2:33:0040:5555:6666:7
How to reproduce:
1 Take the attached GetIP.java
2. Test with above addresses.
I have pasted the output:
on Solaris 8:
---------------
java GetIP ffe0:BAD:2:33:0040:5555:6666:7:
exp mesg ffe0:BAD:2:33:0040:5555:6666:7:
java.net.UnknownHostException: ffe0:BAD:2:33:0040:5555:6666:7:
at java.net.InetAddress.getAllByName0(InetAddress.java:778)
at java.net.InetAddress.getAllByName0(InetAddress.java:748)
at java.net.InetAddress.getAllByName(InetAddress.java:742)
at GetIP.main(GetIP.java:11)
on Linux RH6.2:
----------------
java GetIP ffe0:BAD:2:33:0040:5555:6666:7:
iadr length 1
host name ffe0:BAD:2:33:0040:5555:6666:7:
AFter getting iadr
AFter getting niface
network interface null
ip address : [ffe0:bad:2:33:40:5555:6666:7]
Host Name :ffe0:BAD:2:33:0040:5555:6666:7:
Host aadd byte arr [B@5ff48b
v6 address
NOt org local scope
working....