Exception on valid link-local ipv6 address
EvilSmiff opened this issue · comments
using a link-local ip address such as: fe80::302f:51e0:1313:f50d%5
causes an exception to be thrown whereas it's actually a valid address. The %5 is a reference to a scope id that the ipv6 address belongs to.
https://superuser.com/questions/99746/why-is-there-a-percent-sign-in-the-ipv6-address
I'm a noob when it comes to git but I've got a workaround that seems to work by adding the lines below (with the +) to the RE_IPV6ADDRLIKE_COMPRESSED
regex.
RE_IPV6ADDRLIKE_COMPRESSED = %r{
\A
( (?: (?: [\da-f]{1,4} : )* [\da-f]{1,4} )? )
::
( (?:
( (?: [\da-f]{1,4} : )* )
(?:
[\da-f]{1,4}
|
(\d+) \. (\d+) \. (\d+) \. (\d+)
+ |
+ [\da-f]{1,4} %[\d]+
)
)? )
\z
Regards
Martyn
Do you want me to walk you through the process of making a PR?
Actually the more I think about this, the less convinced I am this is the correct solution. It looks like the script avoids link-local addresses completely due to it being new functionality. I think the correct action at the moment is probably to filter the link-local addresses from being checked before they hit ipaddr.rb.
Thanks anyway.