Re #2071: Specify socktype hint when calling getaddrinfo, to reduce the number of addresses returned.

Thanks to Alexander Traud for the patch.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5707 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Sauw Ming 2017-12-04 01:28:40 +00:00
parent e25c665c69
commit a39e60661e
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename,
/* Call getaddrinfo() */
pj_bzero(&hint, sizeof(hint));
hint.ai_family = af;
hint.ai_socktype = pj_SOCK_DGRAM() | pj_SOCK_STREAM();
rc = getaddrinfo(nodecopy, NULL, &hint, &res);
if (rc != 0)