[#99426] [Ruby master Bug#17098] Float#negative? reports negative zero as not negative — chris@...

Issue #17098 has been reported by chrisseaton (Chris Seaton).

12 messages 2020/08/01

[#99449] [Ruby master Bug#17100] Ractor: a proposal for new concurrent abstraction without thread-safety issues — ko1@...

Issue #17100 has been reported by ko1 (Koichi Sasada).

41 messages 2020/08/03

[#99474] [Ruby master Feature#17103] Add a :since option to ObjectSpace.dump_all — jean.boussier@...

Issue #17103 has been reported by byroot (Jean Boussier).

9 messages 2020/08/04

[#99485] [Ruby master Misc#17104] Why are interpolated string literals frozen? — bughitgithub@...

Issue #17104 has been reported by bughit (bug hit).

23 messages 2020/08/05

[#99499] [Ruby master Bug#17105] A single `return` can return to two different places in a proc inside a lambda inside a method — eregontp@...

Issue #17105 has been reported by Eregon (Benoit Daloze).

10 messages 2020/08/06

[#99582] [Ruby master Feature#17122] Add category to Warning#warn — eileencodes@...

Issue #17122 has been reported by eileencodes (Eileen Uchitelle).

20 messages 2020/08/13

[#99700] [Ruby master Bug#17129] bundle install `eventmachine` and `sassc` fails since 914b2208ab3eddec478cdc3e079e6c30d0f0892c — yasuo.honda@...

Issue #17129 has been reported by yahonda (Yasuo Honda).

9 messages 2020/08/26

[ruby-core:99686] [Ruby master Bug#17112] Resolv.getaddress fails with IPv6 link-local addresses

From: merch-redmine@...
Date: 2020-08-24 22:33:34 UTC
List: ruby-core #99686
Issue #17112 has been updated by jeremyevans0 (Jeremy Evans).

Assignee set to akr (Akira Tanaka)

I've added a pull request with a fix for this: https://github.com/ruby/ruby/pull/3452

----------------------------------------
Bug #17112: Resolv.getaddress fails with IPv6 link-local addresses 
https://bugs.ruby-lang.org/issues/17112#change-87174

* Author: daniel-rikowski (Daniel Rikowski)
* Status: Open
* Priority: Normal
* Assignee: akr (Akira Tanaka)
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
I noticed that I cannot resolve any link-local IPv6 address using `Resolv.getaddress`. For example calling `Resolv.getaddress('fe80::eca4:7b00:ecc5:206c%8')` fails with `Resolv::ResolvError`
Resolving any IPv4 address succeedes, as well as resolving the loopback address `::1`. 


After some code digging I noticed that `Resolv::DNS` doesn't even attempt to resolve that IP address. It checks if there is any local IPv6 interface with an IP address which is not a loopback or a link-local address.

```ruby
def each_address(name)
  each_resource(name, Resource::IN::A) {|resource| yield resource.address}
  if use_ipv6? # <===== false on my system
	each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
  end
end
```

`use_ipv6?` ultimately boils down to this:

```ruby
Socket.ip_address_list.any? {|a| a.ipv6? && !a.ipv6_loopback? && !a.ipv6_linklocal? }
```


In other words if the system doesn't have a "real" IPv6 address, `Resolv.getaddress` cannot resolve link-local addresses. (`::1` is resolved using `Resolv::Hosts` which doesn't perform the same check)


One could argue that IP addresses don't have to be resolved, and I could just perform a regex check and skip `Resolv.getaddress` if I already have an IP address. 
Unfortunately that is not possible when using `resolv-replace`. In that case most (all?) of Ruby's address resolving is piped through `Resolv.getaddress`. 
(That is how I noticed this bug: The RubyMine test runner uses drb which connects to a process on the same machine using a link-local IPv6 address. Since I'm using `resolv-replace` and I don't have a network interface with a non-loopback non-local-link address I encountered this bug.)

Platform:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]
Microsoft Windows [Version 10.0.18363.959]




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

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

In This Thread

Prev Next