From 7470fd92748d25978a1236d02a9e060de13eb58b Mon Sep 17 00:00:00 2001 From: nuttxs Date: Wed, 13 Aug 2025 19:40:42 +0800 Subject: [PATCH] sys/socket.h: Since `ss_family` is of type `uint16_t` (2-byte alignment), packing the internal substructures will reduce the overall alignment of `sockaddr_storage` to 2, which triggers an unaligned access warning in 32-bit systems. Add an overall 8-byte alignment to the outermost layer of the structure. Related commit: 855336bf Refer to https://datatracker.ietf.org/doc/html/rfc2553#section-3.10 Signed-off-by: nuttxs --- include/sys/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index 05a6d38355..70c4261188 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -323,7 +323,7 @@ * the fields of those structures without alignment problems. */ -struct sockaddr_storage +struct aligned_data(SS_ALIGNSIZE) sockaddr_storage { sa_family_t ss_family; /* Address family */