diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-10-31 21:34:01 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-10-31 21:34:01 +0000 |
commit | c02fa54041a68c12107ec577770ff81329af3bef (patch) | |
tree | ac6d3ee86cd046eca0c09c2de43695b5f3116d69 /resolv/res_send.c | |
parent | 242bfefc41f4cc06dcff88c5bd143cc43719a73a (diff) |
Updated to fedora-glibc-20081031T2102cvs/fedora-glibc-2_8_90-16
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r-- | resolv/res_send.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c index 59cdc214e2..ac5cc0b4fe 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -784,7 +784,7 @@ send_vc(res_state statp, #else int aligned_resplen = ((resplen + __alignof__ (HEADER) - 1) - & (__alignof__ (HEADER) - 1)); + & ~(__alignof__ (HEADER) - 1)); *anssizp2 = orig_anssizp - aligned_resplen; *ansp2 = *ansp + aligned_resplen; #endif @@ -1008,7 +1008,7 @@ send_dg(res_state statp, } if (n == 0) { Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n")); - if (recvresp1 || (buf2 != NULL && recvresp2)) + if (resplen > 1 && (recvresp1 || (buf2 != NULL && recvresp2))) { *resplen2 = 1; return resplen; @@ -1058,8 +1058,16 @@ send_dg(res_state statp, /* No buffer allocated for the first reply. We can try to use the rest of the user-provided buffer. */ +#ifdef _STRING_ARCH_unaligned *anssizp2 = orig_anssizp - resplen; *ansp2 = *ansp + resplen; +#else + int aligned_resplen + = ((resplen + __alignof__ (HEADER) - 1) + & ~(__alignof__ (HEADER) - 1)); + *anssizp2 = orig_anssizp - aligned_resplen; + *ansp2 = *ansp + aligned_resplen; +#endif } else { /* The first reply did not fit into the user-provided buffer. Maybe the second |