[Pkg-voip-commits] [pjproject] 14/14: merge patched into master

Bernhard Schmidt berni at moszumanska.debian.org
Thu Nov 10 09:32:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

berni pushed a commit to branch master
in repository pjproject.

commit 5a47644e5c39538dc8e04ef3ce87316aec8e32d3
Merge: 14834c8 7a07460
Author: Bernhard Schmidt <berni at debian.org>
Date:   Thu Nov 10 10:02:36 2016 +0100

    merge patched into master

 debian/.git-dpm                                    |   4 +-
 ...1-svn-backport-Various-fixes-for-DNS-IPv6.patch | 132 +++++++++++++++++++++
 ...0016-r5473-svn-backport-Fix-pending-query.patch |  26 ++++
 ...r5475-svn-backport-Remove-DNS-cache-entry.patch |  68 +++++++++++
 ...vn-backport-Fix-DNS-write-on-freed-memory.patch |  31 +++++
 debian/patches/series                              |   4 +
 pjlib-util/src/pjlib-util/resolver.c               |  49 ++++----
 pjlib-util/src/pjlib-util/srv_resolver.c           |  17 ++-
 pjsip/src/pjsip/sip_resolve.c                      |  14 +--
 9 files changed, 313 insertions(+), 32 deletions(-)

diff --cc debian/.git-dpm
index 2806e3f,0000000..f34e1da
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,8 @@@
 +# see git-dpm(1) from git-dpm package
- 5a0ded59b572274fa1988d89afbbafeb2cbb34f1
- 5a0ded59b572274fa1988d89afbbafeb2cbb34f1
++7a07460e75b42f2a8f02381a88140491d1703b94
++7a07460e75b42f2a8f02381a88140491d1703b94
 +1047e1c8eed5013605500b204449cbe1e3668430
 +1047e1c8eed5013605500b204449cbe1e3668430
 +pjproject_2.5.5~dfsg.orig.tar.bz2
 +d130318466a02e5734b069ed0e343a5d78c06a5c
 +3506099
diff --cc debian/patches/asterisk/0015-r5471-svn-backport-Various-fixes-for-DNS-IPv6.patch
index 0000000,0000000..d6be8b3
new file mode 100644
--- /dev/null
+++ b/debian/patches/asterisk/0015-r5471-svn-backport-Various-fixes-for-DNS-IPv6.patch
@@@ -1,0 -1,0 +1,132 @@@
++From ff04cf8c66bb448f2f30958508de1d0121db9e54 Mon Sep 17 00:00:00 2001
++From: Richard Mudgett <rmudgett at digium.com>
++Date: Fri, 28 Oct 2016 12:11:30 -0500
++Subject: r5471 svn backport Various fixes for DNS IPv6
++
++Fixed #1974: Various fixes for DNS IPv6
++Patch-Category: asterisk
++---
++ pjlib-util/src/pjlib-util/resolver.c     | 11 +++++------
++ pjlib-util/src/pjlib-util/srv_resolver.c | 17 +++++++++++++++--
++ pjsip/src/pjsip/sip_resolve.c            | 14 +++++++-------
++ 3 files changed, 27 insertions(+), 15 deletions(-)
++
++diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c
++index e5e1bed..d24ef9d 100644
++--- a/pjlib-util/src/pjlib-util/resolver.c
+++++ b/pjlib-util/src/pjlib-util/resolver.c
++@@ -835,7 +835,7 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
++     pj_time_val now;
++     struct res_key key;
++     struct cached_res *cache;
++-    pj_dns_async_query *q;
+++    pj_dns_async_query *q, *p_q = NULL;
++     pj_uint32_t hval;
++     pj_status_t status = PJ_SUCCESS;
++ 
++@@ -849,9 +849,6 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
++     /* Check type */
++     PJ_ASSERT_RETURN(type > 0 && type < 0xFFFF, PJ_EINVAL);
++ 
++-    if (p_query)
++-	*p_query = NULL;
++-
++     /* Build resource key for looking up hash tables */
++     init_res_key(&key, type, name);
++ 
++@@ -970,10 +967,12 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
++     pj_hash_set_np(resolver->hquerybyres, &q->key, sizeof(q->key),
++ 		   0, q->hbufkey, q);
++ 
++-    if (p_query)
++-	*p_query = q;
+++    p_q = q;
++ 
++ on_return:
+++    if (p_query)
+++	*p_query = p_q;
+++
++     pj_mutex_unlock(resolver->mutex);
++     return status;
++ }
++diff --git a/pjlib-util/src/pjlib-util/srv_resolver.c b/pjlib-util/src/pjlib-util/srv_resolver.c
++index 02672aa..ff9c979 100644
++--- a/pjlib-util/src/pjlib-util/srv_resolver.c
+++++ b/pjlib-util/src/pjlib-util/srv_resolver.c
++@@ -187,9 +187,12 @@ PJ_DEF(pj_status_t) pj_dns_srv_cancel_query(pj_dns_srv_async_query *query,
++ 	    has_pending = PJ_TRUE;
++ 	}
++ 	if (srv->q_aaaa) {
++-	    pj_dns_resolver_cancel_query(srv->q_aaaa, PJ_FALSE);
+++	    /* Check if it is a dummy query. */
+++	    if (srv->q_aaaa != (pj_dns_async_query*)0x1) {
+++		pj_dns_resolver_cancel_query(srv->q_aaaa, PJ_FALSE);
+++		has_pending = PJ_TRUE;
+++	    }
++ 	    srv->q_aaaa = NULL;
++-	    has_pending = PJ_TRUE;
++ 	}
++     }
++ 
++@@ -485,12 +488,22 @@ static pj_status_t resolve_hostnames(pj_dns_srv_async_query *query_job)
++ 	srv->common.type = PJ_DNS_TYPE_A;
++ 	srv->common_aaaa.type = PJ_DNS_TYPE_AAAA;
++ 	srv->parent = query_job;
+++	srv->q_a = NULL;
+++	srv->q_aaaa = NULL;
++ 
++ 	status = PJ_SUCCESS;
++ 
++ 	/* Start DNA A record query */
++ 	if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA_ONLY) == 0)
++ 	{
+++	    if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA) != 0) {
+++		/* If there will be DNS AAAA query too, let's setup
+++		 * a dummy one here, otherwise app callback may be called
+++		 * immediately (before DNS AAAA query is sent) when
+++		 * DNS A record is available in the cache.
+++		 */
+++		srv->q_aaaa = (pj_dns_async_query*)0x1;
+++	    }
++ 	    status = pj_dns_resolver_start_query(query_job->resolver,
++ 						 &srv->target_name,
++ 						 PJ_DNS_TYPE_A, 0,
++diff --git a/pjsip/src/pjsip/sip_resolve.c b/pjsip/src/pjsip/sip_resolve.c
++index ed326ba..3f3654d 100644
++--- a/pjsip/src/pjsip/sip_resolve.c
+++++ b/pjsip/src/pjsip/sip_resolve.c
++@@ -452,7 +452,7 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver,
++ 	}
++ 
++ 	/* Resolve DNS AAAA record if address family is not fixed to IPv4 */
++-	if (af != pj_AF_INET()) {
+++	if (af != pj_AF_INET() && status == PJ_SUCCESS) {
++ 	    status = pj_dns_resolver_start_query(resolver->res, 
++ 						 &query->naptr[0].name,
++ 						 PJ_DNS_TYPE_AAAA, 0, 
++@@ -530,9 +530,9 @@ static void dns_a_callback(void *user_data,
++ 
++ 	    ++srv->count;
++ 	}
++-
++-    } else {
++-
+++    }
+++    
+++    if (status != PJ_SUCCESS) {
++ 	char errmsg[PJ_ERR_MSG_SIZE];
++ 
++ 	/* Log error */
++@@ -593,9 +593,9 @@ static void dns_aaaa_callback(void *user_data,
++ 
++ 	    ++srv->count;
++ 	}
++-
++-    } else {
++-
+++    }
+++    
+++    if (status != PJ_SUCCESS) {
++ 	char errmsg[PJ_ERR_MSG_SIZE];
++ 
++ 	/* Log error */
diff --cc debian/patches/asterisk/0016-r5473-svn-backport-Fix-pending-query.patch
index 0000000,0000000..722d17f
new file mode 100644
--- /dev/null
+++ b/debian/patches/asterisk/0016-r5473-svn-backport-Fix-pending-query.patch
@@@ -1,0 -1,0 +1,26 @@@
++From 9a5d2b988bb0de50dac6fcf2295055104be423d4 Mon Sep 17 00:00:00 2001
++From: Richard Mudgett <rmudgett at digium.com>
++Date: Fri, 28 Oct 2016 12:12:28 -0500
++Subject: r5473 svn backport Fix pending query
++
++Re #1974:
++If there is a pending query, set the return value to that query (instead of NULL)
++
++Thanks to Richard Mudgett for the patch.
++Patch-Category: asterisk
++---
++ pjlib-util/src/pjlib-util/resolver.c | 1 +
++ 1 file changed, 1 insertion(+)
++
++diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c
++index d24ef9d..fe687b7 100644
++--- a/pjlib-util/src/pjlib-util/resolver.c
+++++ b/pjlib-util/src/pjlib-util/resolver.c
++@@ -940,6 +940,7 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
++ 	/* Done. This child query will be notified once the "parent"
++ 	 * query completes.
++ 	 */
+++	p_q = nq;
++ 	status = PJ_SUCCESS;
++ 	goto on_return;
++     } 
diff --cc debian/patches/asterisk/0017-r5475-svn-backport-Remove-DNS-cache-entry.patch
index 0000000,0000000..227514a
new file mode 100644
--- /dev/null
+++ b/debian/patches/asterisk/0017-r5475-svn-backport-Remove-DNS-cache-entry.patch
@@@ -1,0 -1,0 +1,68 @@@
++From 83704077762cad6811b4beac5117f7000d8ab9bb Mon Sep 17 00:00:00 2001
++From: Richard Mudgett <rmudgett at digium.com>
++Date: Fri, 28 Oct 2016 12:15:44 -0500
++Subject: r5475 svn backport Remove DNS cache entry
++
++Re #1974: Remove DNS cache entry from resolver's hash table when app callback has a reference.
++
++Thanks to Richard Mudgett for the patch.
++Patch-Category: asterisk
++---
++ pjlib-util/src/pjlib-util/resolver.c | 29 +++++++++++++++--------------
++ 1 file changed, 15 insertions(+), 14 deletions(-)
++
++diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c
++index fe687b7..52b7655 100644
++--- a/pjlib-util/src/pjlib-util/resolver.c
+++++ b/pjlib-util/src/pjlib-util/resolver.c
++@@ -1444,10 +1444,12 @@ static void update_res_cache(pj_dns_resolver *resolver,
++     if (ttl > resolver->settings.cache_max_ttl)
++ 	ttl = resolver->settings.cache_max_ttl;
++ 
+++    /* Get a cache response entry */
+++    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key,
+++    					      sizeof(*key), &hval);
+++
++     /* If TTL is zero, clear the same entry in the hash table */
++     if (ttl == 0) {
++-	cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key, 
++-						  sizeof(*key), &hval);
++ 	/* Remove the entry before releasing its pool (see ticket #1710) */
++ 	pj_hash_set(NULL, resolver->hrescache, key, sizeof(*key), hval, NULL);
++ 
++@@ -1457,24 +1459,23 @@ static void update_res_cache(pj_dns_resolver *resolver,
++ 	return;
++     }
++ 
++-    /* Get a cache response entry */
++-    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key, 
++-    					      sizeof(*key), &hval);
++     if (cache == NULL) {
++ 	cache = alloc_entry(resolver);
++-    } else if (cache->ref_cnt > 1) {
++-	/* When cache entry is being used by callback (to app), just decrement
++-	 * ref_cnt so it will be freed after the callback returns and allocate
++-	 * new entry.
++-	 */
++-	cache->ref_cnt--;
++-	cache = alloc_entry(resolver);
++     } else {
++ 	/* Remove the entry before resetting its pool (see ticket #1710) */
++ 	pj_hash_set(NULL, resolver->hrescache, key, sizeof(*key), hval, NULL);
++ 
++-	/* Reset cache to avoid bloated cache pool */
++-	reset_entry(&cache);
+++	if (cache->ref_cnt > 1) {
+++	    /* When cache entry is being used by callback (to app),
+++	     * just decrement ref_cnt so it will be freed after
+++	     * the callback returns and allocate new entry.
+++	     */
+++	    cache->ref_cnt--;
+++	    cache = alloc_entry(resolver);
+++	} else {
+++	    /* Reset cache to avoid bloated cache pool */
+++	    reset_entry(&cache);
+++	}
++     }
++ 
++     /* Duplicate the packet.
diff --cc debian/patches/asterisk/0018-r5477-svn-backport-Fix-DNS-write-on-freed-memory.patch
index 0000000,0000000..62279b9
new file mode 100644
--- /dev/null
+++ b/debian/patches/asterisk/0018-r5477-svn-backport-Fix-DNS-write-on-freed-memory.patch
@@@ -1,0 -1,0 +1,31 @@@
++From 7a07460e75b42f2a8f02381a88140491d1703b94 Mon Sep 17 00:00:00 2001
++From: Richard Mudgett <rmudgett at digium.com>
++Date: Tue, 1 Nov 2016 12:55:31 -0500
++Subject: r5477 svn backport Fix DNS write on freed memory.
++
++Re #1974: Fix DNS write on freed memory.
++Thanks to Richard Mudgett for the patch.
++Patch-Category: asterisk
++---
++ pjlib-util/src/pjlib-util/resolver.c | 8 +++++++-
++ 1 file changed, 7 insertions(+), 1 deletion(-)
++
++diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c
++index 52b7655..365772e 100644
++--- a/pjlib-util/src/pjlib-util/resolver.c
+++++ b/pjlib-util/src/pjlib-util/resolver.c
++@@ -908,7 +908,13 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
++ 	    /* Must return PJ_SUCCESS */
++ 	    status = PJ_SUCCESS;
++ 
++-	    goto on_return;
+++	    /*
+++	     * We cannot write to *p_query after calling cb because what
+++	     * p_query points to may have been freed by cb.
+++             * Refer to ticket #1974.
+++	     */
+++	    pj_mutex_unlock(resolver->mutex);
+++	    return status;
++ 	}
++ 
++ 	/* At this point, we have a cached entry, but this entry has expired.
diff --cc debian/patches/series
index 6f31536,0000000..049d2c3
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,14 -1,0 +1,18 @@@
 +0001-Remove-pointless-linking-with-libasound.patch
 +0002-Reduce-number-of-libraries-linked-with-pjlib.patch
 +0003-Reduce-number-of-libraries-linked-with-pjmedia.patch
 +0004-Enable-building-python-bindings.patch
 +0005-Remove-video-libs-dependency-for-pj-utils-and-pjnath.patch
 +0006-Reduce-linkage-of-unused-libraries.patch
 +0007-add-v5-suffix-to-soname-of-libpjsua2-2.patch
 +asterisk/0008-asterisk-0001-r5397-pjsip_generic_array_max_count.patch
 +asterisk/0009-asterisk-0001-r5400-pjsip_tx_data_dec_ref.patch
 +asterisk/0010-Fix-1946-Avoid-deinitialization-of-uninitialized-cli.patch
 +asterisk/0011-asterisk-0002-r5435-add-pjsip_inv_session-ref_cnt.patch
 +asterisk/0012-asterisk-0003-r5403-pjsip_IPV6_V6ONLY.patch
 +asterisk/0013-resolver.c-Prevent-SERVFAIL-from-marking-name-server.patch
 +asterisk/0014-Re-1969-Fix-crash-on-using-an-already-destroyed-SSL.patch
++asterisk/0015-r5471-svn-backport-Various-fixes-for-DNS-IPv6.patch
++asterisk/0016-r5473-svn-backport-Fix-pending-query.patch
++asterisk/0017-r5475-svn-backport-Remove-DNS-cache-entry.patch
++asterisk/0018-r5477-svn-backport-Fix-DNS-write-on-freed-memory.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/pjproject.git



More information about the Pkg-voip-commits mailing list