651d8b
From 2becb920e431110c4afc4fa069b051c5940c2096 Mon Sep 17 00:00:00 2001
651d8b
From: Jeremy Evans <code@jeremyevans.net>
651d8b
Date: Fri, 29 May 2020 14:13:30 -0700
651d8b
Subject: [PATCH] Convert ip addresses to canonical form in
651d8b
 Resolv::DNS::Requester::UnconnectedUDP#sender
651d8b
651d8b
Otherwise, if the IP address given is not in canonical form, it
651d8b
won't match, and Resolv will ignore it.
651d8b
651d8b
Fixes [Bug #16439]
651d8b
---
651d8b
 lib/resolv.rb | 1 +
651d8b
 1 file changed, 1 insertion(+)
651d8b
651d8b
diff --git a/lib/resolv.rb b/lib/resolv.rb
651d8b
index e7b45e785a85..d78531e174fd 100644
651d8b
--- a/lib/resolv.rb
651d8b
+++ b/lib/resolv.rb
651d8b
@@ -767,6 +767,7 @@ def recv_reply(readable_socks)
651d8b
         end
651d8b
 
651d8b
         def sender(msg, data, host, port=Port)
651d8b
+          host = Addrinfo.ip(host).ip_address
651d8b
           lazy_initialize
651d8b
           sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
651d8b
           return nil if !sock