mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bugzilla bug 231786: extended PR_GetAddrInfoByName to support PR_AF_INET.
The patch was contributed by John G. Myers <jgmyers@speakeasy.net>. r=wtc and darin.
This commit is contained in:
parent
608059012f
commit
22ba8cf725
@ -2056,7 +2056,7 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname,
|
||||
PRIntn flags)
|
||||
{
|
||||
/* restrict input to supported values */
|
||||
if (af != PR_AF_UNSPEC || flags != PR_AI_ADDRCONFIG) {
|
||||
if ((af != PR_AF_INET && af != PR_AF_UNSPEC) || flags != PR_AI_ADDRCONFIG) {
|
||||
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
@ -2083,7 +2083,7 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname,
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_family = (af == PR_AF_INET) ? AF_INET : AF_UNSPEC;
|
||||
|
||||
/*
|
||||
* it is important to select a socket type in the hints, otherwise we
|
||||
|
Loading…
Reference in New Issue
Block a user