[asterisk-commits] file: branch group/dns_pjsip r434215 - /team/group/dns_pjsip/res/res_pjsip/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 7 09:03:30 CDT 2015


Author: file
Date: Tue Apr  7 09:03:27 2015
New Revision: 434215

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434215
Log:
Fix a bug where if a transport was specified with IPv6 already it could get the IPv6 offset added to it again.

Modified:
    team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c

Modified: team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c
URL: http://svnview.digium.com/svn/asterisk/team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c?view=diff&rev=434215&r1=434214&r2=434215
==============================================================================
--- team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c (original)
+++ team/group/dns_pjsip/res/res_pjsip/pjsip_resolver.c Tue Apr  7 09:03:27 2015
@@ -358,6 +358,10 @@
 		if (ip_addr_ver || target->addr.port) {
 			type = PJSIP_TRANSPORT_UDP;
 		}
+
+		if (ip_addr_ver == 6) {
+			type = (pjsip_transport_type_e)((int) type + PJSIP_TRANSPORT_IPV6);
+		}
 	}
 
 	ast_debug(2, "Transport type for target '%s' is '%s'\n", host, pjsip_transport_get_type_name(type));
@@ -377,7 +381,6 @@
 			addresses.entry[0].addr_len = sizeof(pj_sockaddr_in6);
 			pj_sockaddr_init(pj_AF_INET6(), &addresses.entry[0].addr, NULL, 0);
 			pj_inet_pton(pj_AF_INET6(), &target->addr.host, &addresses.entry[0].addr.ipv6.sin6_addr);
-			addresses.entry[0].type = (pjsip_transport_type_e)((int)addresses.entry[0].type + PJSIP_TRANSPORT_IPV6);
 		}
 
 		pj_sockaddr_set_port(&addresses.entry[0].addr, !target->addr.port ? pjsip_transport_get_default_port_for_type(type) : target->addr.port);




More information about the asterisk-commits mailing list