about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-10-31 17:37:28 +0000
committerUlrich Drepper <drepper@redhat.com>2008-10-31 17:37:28 +0000
commitad12e63582e400495c26df747c597fe2359cccc2 (patch)
treefa16aca7243b61b2011fdd9ebdc0b892cf6e559d
parent1828d6b0f39e98312f8df838ccad7cf8c8130f03 (diff)
downloadglibc-ad12e63582e400495c26df747c597fe2359cccc2.tar.gz
glibc-ad12e63582e400495c26df747c597fe2359cccc2.tar.xz
glibc-ad12e63582e400495c26df747c597fe2359cccc2.zip
[BZ #6942]
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.
-rw-r--r--ChangeLog6
-rw-r--r--resolv/res_send.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d789003b03..b4775de783 100644
--- 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
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 8f0a6018b6..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
@@ -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