summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwchang0222%aol.com <devnull@localhost>2004-01-22 22:22:37 +0000
committerwchang0222%aol.com <devnull@localhost>2004-01-22 22:22:37 +0000
commit6ef982d42d0c9a1d713257119806e5b4ec47409a (patch)
treef68c40208cf5c88cd7d9445a427227658533109f
parent5406102a89379d520825596ed71eadbcd76edd00 (diff)
downloadnspr-hg-6ef982d42d0c9a1d713257119806e5b4ec47409a.tar.gz
Bugzilla bug 231786: extended PR_GetAddrInfoByName to support PR_AF_INET.
The patch is contributed by John G. Myers <jgmyers@speakeasy.net>. r=wtc and darin. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/misc/prnetdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c
index 1dca8366..b26b7539 100644
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -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