DaveAKing / guava-libraries

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

InetAddresses.forString does not correctly handle IPv6 addresses with scope_id #1557

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Issue: InetAddresses.forString throws IllegalArgumentException when given IPv6 
address with scope_id instead of returning the correct Inet6Address with 
scope_id, and scope_id_set populated.

Affected guava versions: InetAddresses in all up to 15.0

Failing test case:

InetAddress ipv6AddressWithScopeId = 
InetAddresses.forString("fe80:0:0:0:c1e1:54cf:68bc:9d5e%12");

throws java.lang.IllegalArgumentException: 'fe80:0:0:0:c1e1:54cf:68bc:9d5e%12' 
is not an IP string literal.

InetAddresses.isInetAddress("fe80:0:0:0:c1e1:54cf:68bc:9d5e%12") return false.

Expected results:

InetAddresses.forString("fe80:0:0:0:c1e1:54cf:68bc:9d5e%12") returns 
Inet6Address(addr = "fe80:0:0:0:c1e1:54cf:68bc:9d5e", scope_id = 12);

InetAddresses.isInetAddress("fe80:0:0:0:c1e1:54cf:68bc:9d5e%12") returns true.

Original issue reported on code.google.com by lot...@gmail.com on 16 Oct 2013 at 8:57

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Nov 2013 at 8:16

GoogleCodeExporter commented 9 years ago
Issue 1844 has been merged into this issue.

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:12

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago

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