diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index 687a6ec42..2f7086a0d 100644 --- a/main/utils.c +++ b/main/utils.c @@ -208,6 +208,8 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp) hp->hp.h_addrtype = AF_INET; hp->hp.h_addr_list = (void *) hp->buf; hp->hp.h_addr = hp->buf + sizeof(void *); + /* For AF_INET, this will always be 4 */ + hp->hp.h_length = 4; if (inet_pton(AF_INET, host, hp->hp.h_addr) > 0) return &hp->hp; return NULL; |