[Glibc-bsd-commits] r6075 - trunk/glibc-ports-2.23/kfreebsd/bits
aurel32 at alioth.debian.org
aurel32 at alioth.debian.org
Tue Jun 28 12:47:52 UTC 2016
Author: aurel32
Date: 2016-06-28 12:47:52 +0000 (Tue, 28 Jun 2016)
New Revision: 6075
Modified:
trunk/glibc-ports-2.23/kfreebsd/bits/socket.h
Log:
Merge from upstream:
commit 3375cfafa7961c6ae0e509c31c3b3cef9ad1f03d
Author: Florian Weimer <fweimer at redhat.com>
Date: Mon May 23 19:43:09 2016 +0200
Make padding in struct sockaddr_storage explicit [BZ #20111]
This avoids aliasing issues with GCC 6 in -fno-strict-aliasing
mode. (With implicit padding, not all data is copied.)
This change makes it explicit that struct sockaddr_storage is
only 126 bytes large on m68k (unlike elsewhere, where we end up
with the requested 128 bytes). The new test case makes sure that
this does not happen on other architectures.
Modified: trunk/glibc-ports-2.23/kfreebsd/bits/socket.h
===================================================================
--- trunk/glibc-ports-2.23/kfreebsd/bits/socket.h 2016-06-11 21:55:45 UTC (rev 6074)
+++ trunk/glibc-ports-2.23/kfreebsd/bits/socket.h 2016-06-28 12:47:52 UTC (rev 6075)
@@ -170,20 +170,20 @@
/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
+ exception of AF_UNIX). */
#if ULONG_MAX > 0xffffffff
# define __ss_aligntype __uint64_t
#else
# define __ss_aligntype __uint32_t
#endif
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+#define _SS_PADSIZE \
+ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
struct sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
+ char __ss_padding[_SS_PADSIZE];
__ss_aligntype __ss_align; /* Force desired alignment. */
- char __ss_padding[_SS_PADSIZE];
};
More information about the Glibc-bsd-commits
mailing list