Actions
Feature #15628
closedinit_inetsock_internal should fallback to IPv4 if IPv6 is unreachable
Feature #15628:
init_inetsock_internal should fallback to IPv4 if IPv6 is unreachable
Description
Hi,
This is not really bug but more of a missing feature. Let me layout steps to reproduce what I am trying to achieve:
- Add local entries for
example.com
$ echo "::1 example.com www.example.com
127.0.0.1 example.com www.example.com" | sudo tee --append /etc/hosts
- Add rule to
DROP
ipv6 packets:sudo ip6tables -P INPUT DROP
- Start a server:
ruby -rwebrick -e 'WEBrick::HTTPServer.new(Port: 8000).start'
- Making request using Net:HTTP with timeout (
Net::OpenTimeout
) after after 60 seconds:ruby -rnet/http -e "Net::HTTP.get(URI('http://example.com:8000'))"
As far as I understand, init_inetsock_internal needs to fallback to ipv4 for Net::HTTP.get to work. IPv6 route being broke is expected and hence, RFC8305 recommends fallback to IPv4.
Support for IPv6 fallback is spotty across languages and http clients, for example, golang supports it but python doesn't, making request with curl
works but wget
hangs.
Actions