r4873 - in glibc-package/branches/glibc-branch-squeeze/debian: . patches patches/any
Author: aurel32
Date: 2011-08-12 18:41:27 +0000 (Fri, 12 Aug 2011)
New Revision: 4873
Added:
glibc-package/branches/glibc-branch-squeeze/debian/patches/any/cvs-resolv-different-nameserver.diff
glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv-assert.diff
Modified:
glibc-package/branches/glibc-branch-squeeze/debian/changelog
glibc-package/branches/glibc-branch-squeeze/debian/patches/series
Log:
* Add patches/any/cvs-resolv-different-nameserver.diff and
patches/any/submitted-resolv-assert.diff to try a different
nameserver if the first one returns REFUSED. Closes: #535504.
Modified: glibc-package/branches/glibc-branch-squeeze/debian/changelog
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/changelog 2011-08-12 18:32:50 UTC (rev 4872)
+++ glibc-package/branches/glibc-branch-squeeze/debian/changelog 2011-08-12 18:41:27 UTC (rev 4873)
@@ -35,6 +35,9 @@
#630077.
* Update submitted-resolv.conf-thread.diff from upstream to fix a
deadlock in some rare cases.
+ * Add patches/any/cvs-resolv-different-nameserver.diff and
+ patches/any/submitted-resolv-assert.diff to try a different
+ nameserver if the first one returns REFUSED. Closes: #535504.
-- Aurelien Jarno <aurel32@debian.org> Sat, 11 Jun 2011 18:12:35 +0200
Added: glibc-package/branches/glibc-branch-squeeze/debian/patches/any/cvs-resolv-different-nameserver.diff
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/patches/any/cvs-resolv-different-nameserver.diff (rev 0)
+++ glibc-package/branches/glibc-branch-squeeze/debian/patches/any/cvs-resolv-different-nameserver.diff 2011-08-12 18:41:27 UTC (rev 4873)
@@ -0,0 +1,52 @@
+2011-06-15 Ulrich Drepper <drepper@gmail.com>
+
+ * resolv/res_send.c (__libc_res_nsend): Fix typos in last patch. We
+ need to dereference resplen2.
+
+2011-05-30 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #12684]
+ * resolv/res_send.c (__libc_res_nsend): Only go to the next name server
+ if both request failed.
+ (send_dg): In case of server errors clear resplen or *resplen2.
+
+---
+ resolv/res_send.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/resolv/res_send.c
++++ b/resolv/res_send.c
+@@ -546,7 +546,7 @@
+ ns, ansp, ansp2, nansp2, resplen2);
+ if (n < 0)
+ return (-1);
+- if (n == 0)
++ if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+ goto next_ns;
+ } else {
+ /* Use datagrams. */
+@@ -556,7 +556,7 @@
+ ansp2, nansp2, resplen2);
+ if (n < 0)
+ return (-1);
+- if (n == 0)
++ if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+ goto next_ns;
+ if (v_circuit)
+ // XXX Check whether both requests failed or
+@@ -1279,10 +1279,14 @@
+ (*thisresplen > *thisanssiz)
+ ? *thisanssiz : *thisresplen);
+
+- if (recvresp1 || (buf2 != NULL && recvresp2))
++ if (recvresp1 || (buf2 != NULL && recvresp2)) {
++ *resplen2 = 0;
+ return resplen;
++ }
+ if (buf2 != NULL)
+ {
++ /* No data from the first reply. */
++ resplen = 0;
+ /* We are waiting for a possible second reply. */
+ if (hp->id == anhp->id)
+ recvresp1 = 1;
Added: glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv-assert.diff
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv-assert.diff (rev 0)
+++ glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv-assert.diff 2011-08-12 18:41:27 UTC (rev 4873)
@@ -0,0 +1,59 @@
+2011-07-21 Aurelien Jarno <aurel32@debian.org>
+
+ * resolv/res_query.c(__libc_res_nquery): Assign hp and hp2
+ depending n and resplen2 to catch cases where answer
+ equals answerp2.
+
+diff --git a/resolv/res_query.c b/resolv/res_query.c
+index 2f7cfaa..405fa68 100644
+--- a/resolv/res_query.c
++++ b/resolv/res_query.c
+@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
+ int *resplen2)
+ {
+ HEADER *hp = (HEADER *) answer;
++ HEADER *hp2;
+ int n, use_malloc = 0;
+ u_int oflags = statp->_flags;
+
+@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
+ /* __libc_res_nsend might have reallocated the buffer. */
+ hp = (HEADER *) *answerp;
+
+- /* We simplify the following tests by assigning HP to HP2. It
+- is easy to verify that this is the same as ignoring all
+- tests of HP2. */
+- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
+-
+- if (n < (int) sizeof (HEADER) && answerp2 != NULL
+- && *resplen2 > (int) sizeof (HEADER))
++ /* We simplify the following tests by assigning HP to HP2 or
++ vice versa. It is easy to verify that this is the same as
++ ignoring all tests of HP or HP2. */
++ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
+ {
+- /* Special case of partial answer. */
+- assert (hp != hp2);
+- hp = hp2;
++ hp2 = hp;
+ }
+- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
+- && n > (int) sizeof (HEADER))
++ else
+ {
+- /* Special case of partial answer. */
+- assert (hp != hp2);
+- hp2 = hp;
++ hp2 = (HEADER *) *answerp2;
++ if (n < (int) sizeof (HEADER))
++ {
++ hp = hp2;
++ }
+ }
+
++ /* Make sure both hp and hp2 are defined */
++ assert((hp != NULL) && (hp2 != NULL));
++
+ if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
+ && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
+ #ifdef DEBUG
Modified: glibc-package/branches/glibc-branch-squeeze/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/patches/series 2011-08-12 18:32:50 UTC (rev 4872)
+++ glibc-package/branches/glibc-branch-squeeze/debian/patches/series 2011-08-12 18:41:27 UTC (rev 4873)
@@ -260,3 +260,5 @@
any/cvs-sunrpc-license.diff
any/submitted-resolv.conf-thread.diff
any/cvs-ignore-origin-privileged.diff
+any/cvs-resolv-different-nameserver.diff
+any/submitted-resolv-assert.diff
Reply to: