mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
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:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user