mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 15:20:10 +00:00
(gaih_inet): If NAME is a numerical IP address and AI_CANONNAME is set, return copy of NAME as ai_canonname.
This commit is contained in:
parent
7dfde5a02a
commit
4376935c17
@ -556,6 +556,14 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
}
|
||||
else
|
||||
return -EAI_ADDRFAMILY;
|
||||
|
||||
dupname:
|
||||
if (req->ai_flags & AI_CANONNAME)
|
||||
{
|
||||
canon = strdup (name);
|
||||
if (canon == NULL)
|
||||
return -EAI_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
if (at->family == AF_UNSPEC)
|
||||
@ -603,6 +611,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
return GAIH_OKIFUNSPEC | -EAI_NONAME;
|
||||
}
|
||||
}
|
||||
|
||||
goto dupname;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user