From: Frederick Bruckman Date: Fri, 20 Jun 2003 19:53:46 +0000 (-0500) Subject: Broader support for IPv6 hostnames by "ntpdc" and "ntpq". On NetBSD X-Git-Tag: NTP_4_2_0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14dc3f74013bbb464aca30203fbb85e47282c71c;p=thirdparty%2Fntp.git Broader support for IPv6 hostnames by "ntpdc" and "ntpq". On NetBSD from NetBSD 1.5 to NetBSD 1.6.1, getaddrinfo() returned EAI_NODATA in some cases where RFC's 2553 (and now 3493) required EAI_NONAME. Allow for that. The (mis-)interpretation was from the Kame project, so other platforms may be affected as well. bk: 3ef3664aX2Rwx-2IbcpadAfgwYa97A --- diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index e7a5c61588..73f3fa1fd9 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -440,7 +440,7 @@ openhost( hints.ai_flags = AI_NUMERICHOST; a_info = getaddrinfo(hname, service, &hints, &ai); - if (a_info == EAI_NONAME) { + if (a_info == EAI_NONAME || a_info == EAI_NODATA) { hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 13de313f46..3aa349de82 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -621,7 +621,7 @@ openhost( hints.ai_flags = AI_NUMERICHOST; a_info = getaddrinfo(hname, service, &hints, &ai); - if (a_info == EAI_NONAME) { + if (a_info == EAI_NONAME || a_info == EAI_NODATA) { hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG;