mkodekar / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

InetAddresses#ipStringToBytes() fails to parse ipv6 with scope #1844

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Dear Guava team,

the InetAddresses#ipStringToBytes() fails to parse ipv6 with scope:

InetAddresses.isInetAddress("fe80:0:0:0:230:48ff:fed3:e52%2"))

will always returns false.

For example code:

InetAddress addr = InetAddress.getByName("fe80:0:0:0:230:48ff:fed3:e52%2");
String addrString = addr.getHostAddress();

if (isInetAddress(addrString)) {
   .....
}

will never work. This is true as well, when IPv6 address taken by querying 
network interfaces.

A possible fix (with corresponding unit test):

https://code.google.com/r/kofemann-inetaddress/source/detail?r=9bad198f9108d14af
b6fa66b064ede0dad6e076d

Thanks,
   kofemann

Original issue reported on code.google.com by kofem...@gmail.com on 4 Sep 2014 at 8:23

GoogleCodeExporter commented 9 years ago
This is already logged here: 
https://code.google.com/p/guava-libraries/issues/detail?id=1557

Original comment by garethda...@gmail.com on 11 Sep 2014 at 12:36

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 11 Sep 2014 at 3:40

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07