From: Russell Bryant Date: Tue, 31 Oct 2006 06:18:36 +0000 (+0000) Subject: When handling the case where the hostname is just an IPV4 numeric address, X-Git-Tag: 1.2.14~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8da54e092e760ae7a1f54ca7f4559e775dbe6ae;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.2@46560 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/utils.c b/utils.c index 8f3dbcd7b3..e712ebe665 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)