[ruby-core:96374] [Ruby master Bug#16439] Resolv::DNS: timeouts if multiple IPv6 name servers are given and address contains leading zero

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.issue-16439.20191220130217.9ad898522cebeab2@ruby-lang.org>
Issue #16439 has been reported by jmr (Jan-Martin Rämer).

----------------------------------------
Bug #16439: Resolv::DNS: timeouts if multiple IPv6 name servers are given and address contains leading zero
https://bugs.ruby-lang.org/issues/16439

* Author: jmr (Jan-Martin Rämer)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Hi,

Resolv::DNS does not return any results under those conditions:
- there are at least two name servers (in /etc/resolv.conf).
- The name servers have IPv6 addresses containing leading zeros.

Example resolv.conf:
nameserver 2001:0db8::0001:1
nameserver 2001:0db8::0002:1

This is caused by a mismatch in representation of the address: Requester::sender_for compares the address of the answering server (e.g. 2001:0db8::1:1) with the address the request was sent to (e.g. 2001:0db8::0001:1).
This can be fixed by stripping leading zeros from the sender's address, as done in the attached patch.

Best regards,
Jan-Martin


---Files--------------------------------
resolv.rb.patch (397 Bytes)


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

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.