each_address should now resolve for AAAA first

AAAA over A is standards track behaviour as per RFC 6724.
This commit is contained in:
Sadiq Saif 2018-11-23 11:38:43 -05:00 committed by Hiroshi SHIBATA
parent 4cd893b048
commit 1b3f18afce
Notes: git 2024-10-03 06:05:03 +00:00

View File

@ -396,10 +396,10 @@ class Resolv
# be a Resolv::IPv4 or Resolv::IPv6
def each_address(name)
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
if use_ipv6?
each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
end
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
end
def use_ipv6? # :nodoc: