From 22ba8cf7254b04b990098305f18a24028c5315e3 Mon Sep 17 00:00:00 2001 From: "wchang0222%aol.com" Date: Thu, 22 Jan 2004 22:27:23 +0000 Subject: [PATCH] Bugzilla bug 231786: extended PR_GetAddrInfoByName to support PR_AF_INET. The patch was contributed by John G. Myers . r=wtc and darin. --- nsprpub/pr/src/misc/prnetdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsprpub/pr/src/misc/prnetdb.c b/nsprpub/pr/src/misc/prnetdb.c index 1dca8366f89f..b26b7539dc34 100644 --- a/nsprpub/pr/src/misc/prnetdb.c +++ b/nsprpub/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