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
parent 02b216e5a7
commit 04b5203a03
Notes: git 2020-05-30 07:59:50 +09:00
1 changed files with 1 additions and 0 deletions

View File

@ -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