[ruby/resolv] Catch EPROTONOSUPPORT as a sign of no IPv6 as well

(https://github.com/ruby/resolv/pull/41)

If IPv6 is disabled inside a freebsd jail, it seems this returns
EPROTONOSUPPORT and not EAFNOSUPPORT. In both cases, we should simply
try some other listed DNS servers.

Fixes [Bug #19928] https://bugs.ruby-lang.org/issues/19928

https://github.com/ruby/resolv/commit/5e2d48708b
This commit is contained in:
KJ Tsanaktsidis 2023-11-24 15:06:20 +11:00 committed by git
parent e3b485213d
commit 02cc9d48f1

View File

@ -750,7 +750,7 @@ class Resolv
next if @socks_hash[bind_host] next if @socks_hash[bind_host]
begin begin
sock = UDPSocket.new(af) sock = UDPSocket.new(af)
rescue Errno::EAFNOSUPPORT rescue Errno::EAFNOSUPPORT, Errno::EPROTONOSUPPORT
next # The kernel doesn't support the address family. next # The kernel doesn't support the address family.
end end
@socks << sock @socks << sock