aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-31 06:18:36 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-31 06:18:36 +0000
commit6f717d780daa9e89d8320bc7d62161f1ea22c187 (patch)
treef46366504295d60a831e3380470109049c49d9a4 /utils.c
parent8ef2db3dbf77f28f564348d64d48ca853d8411a9 (diff)
When handling the case where the hostname is just an IPV4 numeric address,
be sure to set the address type. (issue #8247, alexr) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@46560 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 8f3dbcd7b..e712ebe66 100644
--- a/utils.c
+++ b/utils.c
@@ -195,6 +195,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
if (dots != 3)
return NULL;
memset(hp, 0, sizeof(struct ast_hostent));
+ hp->hp.h_addrtype = AF_INET;
hp->hp.h_addr_list = (void *) hp->buf;
hp->hp.h_addr = hp->buf + sizeof(void *);
if (inet_pton(AF_INET, host, hp->hp.h_addr) > 0)