about summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-16 20:29:33 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-16 20:29:33 +0000
commit74b3cf224e48ce2a10cd70f5f3a911fc6f2718bc (patch)
tree4e6b97bff6b2310f1fdbf7bbb766afd05c737c1d /resolv
parent733ca93a45e09a3f4e04004943fe1051d4cedff5 (diff)
downloadglibc-74b3cf224e48ce2a10cd70f5f3a911fc6f2718bc.tar.gz
glibc-74b3cf224e48ce2a10cd70f5f3a911fc6f2718bc.tar.xz
glibc-74b3cf224e48ce2a10cd70f5f3a911fc6f2718bc.zip
(send_dg): Don't just ignore the result we got in case we only receive one reply in single-request mode.
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_send.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index a339c2be51..25a854f72e 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1048,9 +1048,7 @@ send_dg(res_state statp,
 	}
 	if (n == 0) {
 		Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
-		if (!single_request
-		    && resplen > 1
-		    && (recvresp1 || (buf2 != NULL && recvresp2)))
+		if (resplen > 1 && (recvresp1 || (buf2 != NULL && recvresp2)))
 		  {
 		    /* There are quite a few broken name servers out
 		       there which don't handle two outstanding
@@ -1059,9 +1057,15 @@ send_dg(res_state statp,
 		       having received one answer switch to the mode
 		       where we send the second request only once we
 		       have received the first answer.  */
-		    single_request = true;
-		    *gotsomewhere = save_gotsomewhere;
-		    goto retry;
+		    if (!single_request)
+		      {
+			single_request = true;
+			*gotsomewhere = save_gotsomewhere;
+			goto retry;
+		      }
+
+		    *resplen2 = 1;
+		    return resplen;
 		  }
 
 		*gotsomewhere = 1;