From 855336bf42dd168cbe1e86726fc5a8604abb16a7 Mon Sep 17 00:00:00 2001 From: nuttxs Date: Fri, 1 Nov 2024 17:24:11 +0800 Subject: [PATCH] sys/socket: use __attribute__((packed)) to avoid changes in the size of struct sockaddr_storage due to struct alignment --- 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 fc604bde20959..85dcc75bfa4db 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -327,7 +327,7 @@ struct sockaddr_storage /* Following fields are implementation-defined */ - struct + struct __attribute__((packed)) { char ss_pad1[SS_PAD1SIZE]; /* 6-byte pad; this is to make implementation-defined * pad up to alignment field that follows explicit in