fixes bug 220020 "PR_EnumerateAddrInfo should not special case port 0" r=wtc

This commit is contained in:
darin%meer.net 2003-09-23 17:47:44 +00:00
parent a856106611
commit cc7d8e978f

View File

@ -2139,8 +2139,10 @@ PR_IMPLEMENT(void *) PR_EnumerateAddrInfo(void *iterPtr,
if (ai->ai_addrlen < sizeof(PRNetAddr))
memset(((char*)result)+ai->ai_addrlen, 0, sizeof(PRNetAddr) - ai->ai_addrlen);
if (port != 0)
result->inet.port = PR_htons(port);
if (result->raw.family == PR_AF_INET)
result->inet.port = htons(port);
else
result->ipv6.port = htons(port);
}
return ai;