Skip to content

Commit 04b5203

Browse files
committed
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]
1 parent 02b216e commit 04b5203

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/resolv.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ def recv_reply(readable_socks)
767767
end
768768

769769
def sender(msg, data, host, port=Port)
770+
host = Addrinfo.ip(host).ip_address
770771
lazy_initialize
771772
sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
772773
return nil if !sock

0 commit comments

Comments
 (0)