Convert ip addresses to canonical form in Resolv::DNS::Requester::UnconnectedUDP#sender

Otherwise, if the IP address given is not in canonical form, it
won't match, and Resolv will ignore it.

Fixes [Bug #16439]
This commit is contained in:
Jeremy Evans 2020-05-29 14:13:30 -07:00
Родитель 02b216e5a7
Коммит 04b5203a03
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -767,6 +767,7 @@ class Resolv
end
def sender(msg, data, host, port=Port)
host = Addrinfo.ip(host).ip_address
lazy_initialize
sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
return nil if !sock