Page MenuHomePhabricator

socket: non blocking connection do not try IPv4 address after failing to connect to IPv6 address
Open, NormalPublic

Description

In libssh, if an provided hostname resolves to IPv6 and IPv4 addresses, the connection tries only the first one. Usually it tries IPv6 first and usually fails before trying the IPv4 address.

Event Timeline

ansasaki created this task.Dec 6 2018, 4:46 PM
asn assigned this task to ansasaki.Feb 27 2019, 8:36 AM
asn triaged this task as Normal priority.
asn added a project: Restricted Project.

The easiest way to reproduce this is to put something like this in /etc/hosts:

2001:db8::1 testing
192.168.0.1 testing

and then try to ./examples/ssh-client -vvvv testing. The client only tries the first address and gives up without trying the next.