1 commit 4769ae77fc6c8dacea6476addb015c8797848cdd
2 Author: Ulrich Drepper <drepper@gmail.com>
3 Date: Mon May 30 22:48:47 2011 -0400
5 Handle DNS server failures in case of AF_UNSPEC lookups correctly
7 diff --git a/ChangeLog b/ChangeLog
8 index 31719ab..dd4ad9e 100644
12 2011-05-30 Ulrich Drepper <drepper@gmail.com>
15 + * resolv/res_send.c (__libc_res_nsend): Only go to the next name server
16 + if both request failed.
17 + (send_dg): In case of server errors clear resplen or *resplen2.
20 * elf/dl-deps.c (_dl_map_object_deps): Run initializer sorting only
21 when there are multiple maps.
22 diff --git a/resolv/res_send.c b/resolv/res_send.c
23 index 845b658..97142b7 100644
24 --- a/resolv/res_send.c
25 +++ b/resolv/res_send.c
26 @@ -549,7 +549,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
27 ns, ansp, ansp2, nansp2, resplen2);
31 + if (n == 0 && (buf2 == NULL || resplen2 == 0))
35 @@ -559,7 +559,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
36 ansp2, nansp2, resplen2);
40 + if (n == 0 && (buf2 == NULL || resplen2 == 0))
43 // XXX Check whether both requests failed or
44 @@ -1275,10 +1275,14 @@ send_dg(res_state statp,
45 (*thisresplenp > *thisanssizp)
46 ? *thisanssizp : *thisresplenp);
48 - if (recvresp1 || (buf2 != NULL && recvresp2))
49 + if (recvresp1 || (buf2 != NULL && recvresp2)) {
55 + /* No data from the first reply. */
57 /* We are waiting for a possible second reply. */
58 if (hp->id == anhp->id)
60 @@ -1344,7 +1348,7 @@ send_dg(res_state statp,
64 - /* poll should not have returned > 0 in this case. */
65 + /* poll should not have returned > 0 in this case. */