An interpreter of object-oriented scripting language
Go to file
Jarek Prokop aa7e8debee Revert adding AI_ADDRCONFIG flag to getaddrinfo(3) calls.
It is causing problems when network is in certain, valid, configuration.
The point of it is to workaround a glibc bug that is not present for us.
https://bugs.ruby-lang.org/issues/20208

To reproduce, have IPv6 enabled localhost but only IPv4
interfaces (such as eth0, name and count of them may vary based on system)
to disable public interfaces via sysctl:
`$ sysctl "net.ipv6.conf.<interface>.disable_ipv6=1"`
Where <interface> is NOT lo but can be eth0 or other.

Confirm with command `$ ip addr` command that only `lo`
interface has IPv6 address.

and run the following with Ruby 3.3:
~~~
$ ruby -rnet/http -e 'http = Net::HTTP.new("localhost", 8080); http.local_host = Addrinfo.tcp("localhost", 8080).ip_address; p http.get("/")'
~~~
The error is then related to EAFNOSUPPORT:
```
Errno::EAFNOSUPPORT: Failed to open TCP connection to localhost:37337 (Address family not supported by protocol - bind(2) for "::1" port 45395)
```

running above Ruby command with `strace` suggest that
there is an attempt to bind with AF_INET6
using an AF_INET socket, however, only if the reproducer above
attempts to set the `http.local_host` with Addrinfo.

From upstream issue #20208:
"This is calling getaddrinfo to resolve "localhost" for us to use
it as the local side of the connection. Because Ruby does not know
what you intend to do with this IP address, it does not make the request
with AI_ADDRCONFIG. Thus, you get an IPv6 result returned,
since there is an IPv6 addres for localhost!"
2024-01-26 13:54:20 +01:00
.gitignore Upgrade to Ruby 3.0.0. 2021-01-04 16:42:55 +01:00
libruby.stp Add TapSet for Ruby. 2013-02-22 14:17:04 +01:00
macros.ruby Add %{ruby_default_filter} macro. 2013-04-30 14:42:13 +02:00
macros.rubygems Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
operating_system.rb Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-always-use-i386.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-custom-rubygems-location.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-Enable-configuration-of-archlibdir.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.3.0-ruby_version.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.7.0-Initialize-ABRT-hook.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.3.0-Disable-syntax-suggest-test-case.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.3.0-Revert-Optimize-allocations-in-Hash-compare_by_identity.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.4.0-fix-branch-protection-compilation-for-arm.patch Fix compiling coroutines with aarch64's branch protection. 2024-01-15 16:38:51 +01:00
ruby-3.4.0-Revert-Set-AI_ADDRCONFIG-when-making-getaddrinfo.patch Revert adding AI_ADDRCONFIG flag to getaddrinfo(3) calls. 2024-01-26 13:54:20 +01:00
ruby-3.4.0-ruby-net-http-Renew-test-certificates.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-exercise.stp Add missing ruby-exercise.stp file. 2013-02-22 14:17:53 +01:00
ruby.rpmlintrc Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby.spec Revert adding AI_ADDRCONFIG flag to getaddrinfo(3) calls. 2024-01-26 13:54:20 +01:00
rubygems.attr Add conflicts RPM generator. 2018-02-13 13:50:15 +01:00
rubygems.con Add conflicts RPM generator. 2018-02-13 13:50:15 +01:00
rubygems.prov Upgrade to Ruby 2.6.0. 2019-01-17 08:31:01 +01:00
rubygems.req Extract composition of dependecy strings into helper. 2019-01-24 10:38:43 +01:00
sources Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
test_abrt.rb Move the ABRT hook test into separate file. 2015-12-13 19:36:58 +01:00
test_openssl_fips.rb Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-09-22 12:54:53 +02:00
test_systemtap.rb Upgrade to Ruby 2.4.0. 2017-01-09 15:58:21 +01:00