[前][次][番号順一覧][スレッド一覧]

ruby-changes:61428

From: Jeremy <ko1@a...>
Date: Sat, 30 May 2020 07:59:44 +0900 (JST)
Subject: [ruby-changes:61428] 04b5203a03 (master): Convert ip addresses to canonical form in Resolv::DNS::Requester::UnconnectedUDP#sender

https://git.ruby-lang.org/ruby.git/commit/?id=04b5203a03

From 04b5203a031d372b725e407519f10da6deda0e78 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Fri, 29 May 2020 14:13:30 -0700
Subject: 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]

diff --git a/lib/resolv.rb b/lib/resolv.rb
index e7b45e7..d78531e 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -767,6 +767,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L767
         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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]