]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(send_dg): Don't just ignore the result we got in case we only receive one reply...
authorUlrich Drepper <drepper@redhat.com>
Thu, 16 Apr 2009 20:29:33 +0000 (20:29 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 16 Apr 2009 20:29:33 +0000 (20:29 +0000)
resolv/res_send.c

index a339c2be51be55c324a80dcd51460304730b6fd4..25a854f72e11599039f3621326f5904c479ef6c6 100644 (file)
@@ -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;