From: Miroslav Lichvar Date: Thu, 25 May 2017 14:12:50 +0000 (+0200) Subject: client: try to connect to all addresses before giving up X-Git-Tag: 3.2-pre1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c049bce007860fb9bde2b0e508cae789e92ff844;p=thirdparty%2Fchrony.git client: try to connect to all addresses before giving up Don't give up when one of the addresses/hostnames specified by -h fails to resolve in DNS_Name2IPAddress(), e.g. with the default setting try to connect to ::1 even when 127.0.0.1 failed due to the -6 option. --- diff --git a/client.c b/client.c index b3e8c76e..6c606d8c 100644 --- a/client.c +++ b/client.c @@ -172,7 +172,7 @@ get_sockaddrs(const char *hostnames, int port) } else { if (DNS_Name2IPAddress(hostname, ip_addrs, DNS_MAX_ADDRESSES) != DNS_Success) { DEBUG_LOG("Could not get IP address for %s", hostname); - break; + continue; } for (i = 0; i < DNS_MAX_ADDRESSES && ip_addrs[i].family != IPADDR_UNSPEC; i++) {