diff options
author | ume <ume@FreeBSD.org> | 2003-10-23 13:55:36 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-10-23 13:55:36 +0000 |
commit | 0bbe986bd73c2eec22bb91861453d3d7c16d6b09 (patch) | |
tree | 185652250bdc3818edc8ad2471d9598ac26b73db /lib/libc/net | |
parent | feaeb43d02b84e57f77d9ab15abb3e6d6bf62595 (diff) | |
download | FreeBSD-src-0bbe986bd73c2eec22bb91861453d3d7c16d6b09.zip FreeBSD-src-0bbe986bd73c2eec22bb91861453d3d7c16d6b09.tar.gz |
EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493
(aka RFC2553bis). Now, getaddrinfo(3) returns EAI_NONAME
instead of EAI_NODATA. Our getaddrinfo(3) nor getnameinfo(3)
didn't use EAI_ADDRFAMILY.
Obtained from: KAME
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/getaddrinfo.3 | 7 | ||||
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 14 |
2 files changed, 4 insertions, 17 deletions
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3 index c1932af..36922da 100644 --- a/lib/libc/net/getaddrinfo.3 +++ b/lib/libc/net/getaddrinfo.3 @@ -520,10 +520,6 @@ Non-zero error codes are defined in and as follows: .Pp .Bl -tag -width EAI_ADDRFAMILY -compact -.It Dv EAI_ADDRFAMILY -Address family for -.Fa nodename -not supported. .It Dv EAI_AGAIN Temporary failure in name resolution. .It Dv EAI_BADFLAGS @@ -538,9 +534,6 @@ address family is not supported. .It Dv EAI_MEMORY Memory allocation failure. -.It Dv EAI_NODATA -No address associated with -.Fa nodename . .It Dv EAI_NONAME Neither .Fa nodename diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index b298928..3173dc1 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -244,17 +244,11 @@ static struct ai_errlist { int code; } ai_errlist[] = { { "Success", 0, }, -#ifdef EAI_ADDRFAMILY - { "Address family for hostname not supported", EAI_ADDRFAMILY, }, -#endif { "Temporary failure in name resolution", EAI_AGAIN, }, { "Invalid value for ai_flags", EAI_BADFLAGS, }, { "Non-recoverable failure in name resolution", EAI_FAIL, }, { "ai_family not supported", EAI_FAMILY, }, { "Memory allocation failure", EAI_MEMORY, }, -#ifdef EAI_NODATA - { "No address associated with hostname", EAI_NODATA, }, -#endif { "hostname nor servname provided, or not known", EAI_NONAME, }, { "servname not supported for ai_socktype", EAI_SERVICE, }, { "ai_socktype not supported", EAI_SOCKTYPE, }, @@ -524,10 +518,10 @@ getaddrinfo(hostname, servname, hints, res) if (sentinel.ai_next) goto good; + if (hostname == NULL) + ERR(EAI_NONAME); /* used to be EAI_NODATA */ if (pai->ai_flags & AI_NUMERICHOST) ERR(EAI_NONAME); - if (hostname == NULL) - ERR(EAI_NODATA); if ((pai->ai_flags & AI_ADDRCONFIG) != 0 && !addrconfig(&ai0)) ERR(EAI_FAIL); @@ -628,7 +622,7 @@ explore_fqdn(pai, hostname, servname, res) error = EAI_FAIL; goto free; case NS_NOTFOUND: - error = EAI_NODATA; + error = EAI_NONAME; goto free; case NS_SUCCESS: error = 0; @@ -843,7 +837,7 @@ explore_numeric_scope(pai, hostname, servname, res) sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr; if (ip6_str2scopeid(scope, sin6, &scopeid) == -1) { free(hostname2); - return(EAI_NODATA); /* XXX: is return OK? */ + return(EAI_NONAME); /* XXX: is return OK? */ } sin6->sin6_scope_id = scopeid; } |