about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-24 17:51:45 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-24 17:51:45 +0000
commite20038838008fdc87dc36d256e72190a39f17a1a (patch)
treecc4a2596964bcaf28f5d16ac9987e0b66733daa3
parentacbb987309f328b1679f5aef2804c603113c6426 (diff)
downloadglibc-e20038838008fdc87dc36d256e72190a39f17a1a.tar.gz
glibc-e20038838008fdc87dc36d256e72190a39f17a1a.tar.xz
glibc-e20038838008fdc87dc36d256e72190a39f17a1a.zip
* resolv/res_send.c (send_dg): If we already have one of two
	answers and the server reports SERVFAI, NOTIMP, or REFUSED, then
	use the one answer insted of failing.
-rw-r--r--ChangeLog6
-rw-r--r--resolv/res_send.c30
2 files changed, 30 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 499da8fae7..f61d3d43da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-24  Ulrich Drepper  <drepper@redhat.com>
+
+	* resolv/res_send.c (send_dg): If we already have one of two
+	answers and the server reports SERVFAI, NOTIMP, or REFUSED, then
+	use the one answer insted of failing.
+
 2008-02-20  Ryan S. Arnold  <rsa@us.ibm.com>
 
 	* math/libm-test.inc (exp_test): Exclude expl(1000.0L) from
diff --git a/resolv/res_send.c b/resolv/res_send.c
index e67ef1c676..e78ff967aa 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1001,12 +1001,12 @@ send_dg(res_state statp,
 		need_recompute = 1;
 	}
 	if (n == 0) {
-		Dprint(statp->options & RES_DEBUG, (stdout,
-						    ";; timeout sending\n"));
-		if (recvresp1)
-		  return resplen;
-		if (buf2 != NULL && recvresp2)
-		  return 1;
+		Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
+		if (recvresp1 || (buf2 != NULL && recvresp2))
+		  {
+		    *resplen2 = 1;
+		    return resplen;
+		  }
 
 		*gotsomewhere = 1;
 		return (0);
@@ -1184,6 +1184,24 @@ send_dg(res_state statp,
 				thisansp,
 				(*thisresplen > *thisanssiz)
 				? *thisanssiz : *thisresplen);
+
+			if (recvresp1 || (buf2 != NULL && recvresp2))
+			  {
+			    *resplen2 = 1;
+			    return resplen;
+			  }
+			if (buf2 != NULL)
+			  {
+			    /* We are waiting for a possible second reply.  */
+			    resplen = 1;
+			    if (hp->id == anhp->id)
+			      recvresp1 = 1;
+			    else
+			      recvresp2 = 1;
+
+			    goto wait;
+			  }
+
 		next_ns:
 			__res_iclose(statp, false);
 			/* don't retry if called from dig */