gethostbyname isn't reentrant, who knew...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-04-22 00:20:34 +00:00
parent ca493a14e1
commit d3f9887589
12 changed files with 71 additions and 35 deletions

3
acl.c
View File

@@ -139,7 +139,8 @@ int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin)
int ast_get_ip(struct sockaddr_in *sin, char *value)
{
struct hostent *hp;
hp = gethostbyname(value);
struct ast_hostent ahp;
hp = ast_gethostbyname(value, &ahp);
if (hp) {
memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr));
} else {