From 10f33d5e70d9bd59be05e80d9e078cd5a8fd26b7 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Mon, 12 Sep 2011 13:27:04 +0000 Subject: [PATCH] Merged revisions 335320 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r335320 | kmoore | 2011-09-12 08:25:42 -0500 (Mon, 12 Sep 2011) | 9 lines Prevent IAX2 from getting IPv6 addresses via DNS IAX2 does not support IPv6 and getting such addresses from DNS can cause error messages on the remote end involving bad IPv4 address casts in the presence of IPv6/IPv4 tunnels. This patch ensures that IAX2 will not encounter IPv6 addresses via DNS queries. (closes issue ASTERISK-18090) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@335321 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_iax2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index fe9f89c165..67ef917a92 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8584,6 +8584,7 @@ static int iax2_append_register(const char *hostname, const char *username, if (!(reg = ast_calloc(1, sizeof(*reg)))) return -1; + reg->addr.ss.ss_family = AF_INET; if (ast_dnsmgr_lookup(hostname, ®->addr, ®->dnsmgr, srvlookup ? "_iax._udp" : NULL) < 0) { ast_free(reg); return -1; @@ -12429,6 +12430,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st peer->expire = -1; peer->pokeexpire = -1; peer->sockfd = defaultsockfd; + peer->addr.ss.ss_family = AF_INET; if (ast_string_field_init(peer, 32)) peer = peer_unref(peer); }