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
This commit is contained in:
parent
0237ca7b95
commit
37b3e94167
@ -2241,7 +2241,7 @@ tn(int argc, char *argv[])
|
||||
hints.ai_family = family;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
error = getaddrinfo(src_addr, 0, &hints, &src_res);
|
||||
if (error == EAI_NODATA) {
|
||||
if (error == EAI_NONAME) {
|
||||
hints.ai_flags = 0;
|
||||
error = getaddrinfo(src_addr, 0, &hints, &src_res);
|
||||
}
|
||||
@ -2950,7 +2950,7 @@ sourceroute(struct addrinfo *ai, char *arg, char **cpp, int *lenp, int *protop,
|
||||
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
error = getaddrinfo(cp, NULL, &hints, &res);
|
||||
if (error == EAI_NODATA) {
|
||||
if (error == EAI_NONAME) {
|
||||
hints.ai_flags = 0;
|
||||
error = getaddrinfo(cp, NULL, &hints, &res);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user