From 707502ff249e179672b501cee71c2ae35641891b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Sep 2016 12:12:04 -0500 Subject: [PATCH] FS-9597 #resolve [host_lookup does not resolve v6 addrs] %backport=1.6 --- src/switch_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 8567cfb95f..475f7b12d5 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -1654,7 +1654,7 @@ SWITCH_DECLARE(switch_status_t) switch_resolve_host(const char *host, char *buf, return SWITCH_STATUS_FALSE; } - get_addr(buf, buflen, ai->ai_addr, sizeof(*ai->ai_addr)); + get_addr(buf, buflen, ai->ai_addr, sizeof(struct sockaddr_storage)); freeaddrinfo(ai); @@ -1785,7 +1785,7 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma goto doh; } - switch_copy_string(buf, get_addr(abuf, sizeof(abuf), (struct sockaddr *) &iface_out, sizeof(iface_out)), len); + switch_copy_string(buf, get_addr(abuf, sizeof(abuf), (struct sockaddr *) &iface_out, sizeof(struct sockaddr_storage)), len); if (mask) { get_netmask((struct sockaddr_in *) &iface_out, mask); }