Issue #15900 has been updated by jeremyevans0 (Jeremy Evans).


Thank you for the report.  I was able to confirm the issue and that your patch fixes it.  I will apply your patch shortly.

----------------------------------------
Bug #15900: Resolv::DNS#each_name doesn't accept Resolv::IPv{4,6} against documents
https://bugs.ruby-lang.org/issues/15900#change-78405

* Author: Tietew (Toru Iwase)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-06-05 master 84c294eb0b) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
In resolv library, document says `Resolv::DNS#each_name` accepts `String`, `Resolv::IPv4` and `Resolv::IPv6`.
But `Resolv::DNS::IPv{4,6}` raises ResolvError.

```ruby
require 'resolv'
dns = Resolv::DNS.new
dns.each_name(Resolv::IPv4.create('127.0.0.1')) { |name| p name }
```

Expected: `#<Resolv::DNS::Name: localhost.>`
Actual: ```.../resolv.rb:459:in `each_name': cannot interpret as address: 127.0.0.1 (Resolv::ResolvError)```

Patch attached.
Affected versions: All versions (I confirmed 2.2.10, 2.3.8, 2.4.6, 2.5.5, 2.6.3, and master)


---Files--------------------------------
resolv_dns_each_name.patch (1.55 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>