Page MenuHomePhabricator

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


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

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 testing

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