1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

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