[asterisk-commits] kmoore: branch 1.8 r335320 - /branches/1.8/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 12 08:25:45 CDT 2011


Author: kmoore
Date: Mon Sep 12 08:25:42 2011
New Revision: 335320

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335320
Log:
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)

Modified:
    branches/1.8/channels/chan_iax2.c

Modified: branches/1.8/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_iax2.c?view=diff&rev=335320&r1=335319&r2=335320
==============================================================================
--- branches/1.8/channels/chan_iax2.c (original)
+++ branches/1.8/channels/chan_iax2.c Mon Sep 12 08:25:42 2011
@@ -8480,6 +8480,7 @@
 	if (!(reg = ast_calloc(1, sizeof(*reg))))
 		return -1;
 
+	reg->addr.ss.ss_family = AF_INET;
 	if (ast_dnsmgr_lookup(hostname, &reg->addr, &reg->dnsmgr, srvlookup ? "_iax._udp" : NULL) < 0) {
 		ast_free(reg);
 		return -1;
@@ -12309,6 +12310,7 @@
 		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);
 	}




More information about the asterisk-commits mailing list