[BZ #6942]
authorUlrich Drepper <drepper@redhat.com>
Fri, 31 Oct 2008 17:37:28 +0000 (17:37 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 31 Oct 2008 17:37:28 +0000 (17:37 +0000)
2008-10-07  Andreas Schwab  <schwab@suse.de>
[BZ #6942]
* resolv/res_send.c (send_vc): Fix last change.
(send_dg): Align here as well.

ChangeLog
resolv/res_send.c

index d789003..b4775de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-07  Andreas Schwab  <schwab@suse.de>
+
+       [BZ #6942]
+       * resolv/res_send.c (send_vc): Fix last change.
+       (send_dg): Align here as well.
+
 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/ulimit.c (__ulimit): Handle UL_GETFSIZE
index 8f0a601..ac5cc0b 100644 (file)
@@ -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
@@ -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