Skip to content
Commit 48d1a01b authored by Robert Lubos's avatar Robert Lubos Committed by Daniel DeGrasse
Browse files

net: sockets: Specify alignment for sockaddr* structs



To avoid misalignment errors when casting between
sockaddr_storage/sockaddr and specialied sockaddr_* variants, specify
alignment for the former to match the alignment of the others.

The issue was reported by UBSAN:

  utils.c:802:8: runtime error: member access within misaligned
  address 0xf4aff186 for type 'struct sockaddr_in6', which requires
  4 byte alignment

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 8124032c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment