Feature #17524


resolv: add some more characters in IPv6 link local zone id

Added by no6v (Nobuhiro IMAI) about 2 years ago. Updated about 1 year ago.

Target version:


According to RFC6874, IPv6 link local zone id is:

   ZoneID = 1*( unreserved / pct-encoded )

where unreserved in RFC3986 is as follow.

   unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

Actually, docker can create such an interface.

$ docker network create --ipv6 --subnet fe80::/64 --opt ruby
$ ruby -rsocket -e 'p Socket.ip_address_list.last'
#<Addrinfo: fe80::1%ruby_3.0.0-1>

This makes TestResolvAddr#test_valid_socket_ip_address_list failure.
Supporting a pct-encoded may be overwork, but adding the all of unreserved to

  • Resolv::IPv6::Regex_8HexLinkLocal and
  • Resolv::IPv6::Regex_CompressedHexLinkLocal

sounds reasonable for me. What do you think?

Updated by jeremyevans0 (Jeremy Evans) about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to akr (Akira Tanaka)

This seems reasonable to me. I chose a more conservative approach in the initial implementation, but we've already had to expand it once for s390, and if adding the rest of the unreserved characters fixes docker, we should do that.

I've submitted a pull request upstream for this:

Updated by no6v (Nobuhiro IMAI) about 2 years ago

Thanks for your comment and pull request. That is what I expected.
I'm looking forward it to be merged.

Updated by jaruga (Jun Aruga) almost 2 years ago

I just faced this issue where cni-podman0 including - is used as string matching with Resolv::IPv6::Regex_CompressedHexLinkLocal.

$ ruby -rsocket -e 'p Socket.ip_address_list[8]'
#<Addrinfo: fe80::9856:24ff:fe1b:f759%cni-podman0>

Updated by gotoken (Kentaro Goto) about 1 year ago

With ruby 3.1.0 on my LXC box, this is the only problem reported as a failure with make test-all.
It would be helpful if you could merge

Actions #5

Updated by jeremyevans0 (Jeremy Evans) about 1 year ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF