Project

General

Profile

Actions

Bug #15900

closed

Resolv::DNS#each_name doesn't accept Resolv::IPv{4,6} against documents

Added by Tietew (Toru Iwase) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-06-05 master 84c294eb0b) [x86_64-linux]
[ruby-core:92977]

Description

In resolv library, document says Resolv::DNS#each_name accepts String, Resolv::IPv4 and Resolv::IPv6.
But Resolv::DNS::IPv{4,6} raises ResolvError.

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) resolv_dns_each_name.patch Tietew (Toru Iwase), 06/05/2019 11:04 AM

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

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

Actions #2

Updated by jeremyevans (Jeremy Evans) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset git|66508992483ae5d77b56a98427c50c772341c0ac.


Make Resolv::DNS#each_name accept Resolv::IPv{4,6} arguments

These arguments were previously documented as supported, but not
actually supported.

Patch from Toru Iwase

Fixes [Bug #15900]

Updated by Tietew (Toru Iwase) over 4 years ago

Could you please backport to 2.5 and 2.6?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0