T127: socket: non blocking connection do not try IPv4 address after failing to connect to IPv6 address
Description
Originally reported by ansasaki: https://bugs.libssh.org/T127
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.
Comments:
ansasaki commented on 2019-06-26 14:51:18 UTC:
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.