diff --git a/main/utils.c b/main/utils.c index 6e1b4674f6..b1c1541314 100644 --- a/main/utils.c +++ b/main/utils.c @@ -204,6 +204,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)