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 <zhaoqing.zhang@sony.com>
This commit is contained in:
nuttxs 2025-08-13 19:40:42 +08:00 committed by Xiang Xiao
parent 93c1e0c633
commit 7470fd9274

View file

@ -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 */