]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Broader support for IPv6 hostnames by "ntpdc" and "ntpq". On NetBSD
authorFrederick Bruckman <bruckman@ntp.org>
Fri, 20 Jun 2003 19:53:46 +0000 (14:53 -0500)
committerFrederick Bruckman <bruckman@ntp.org>
Fri, 20 Jun 2003 19:53:46 +0000 (14:53 -0500)
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

ntpdc/ntpdc.c
ntpq/ntpq.c

index e7a5c61588802015d636406c55e53f5febaa8647..73f3fa1fd9c46583532c9dd606ab599f2015f3a5 100644 (file)
@@ -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;
index 13de313f46e06ca72ab1a24b9eb935d09c02ea5c..3aa349de82a458df6fce613c3308ea798737ea01 100644 (file)
@@ -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;