[libc-commits] [libc] [libc] Give struct sockaddr its full sa_data (PR #236518)

Mike Lothian via libc-commits libc-commits at lists.llvm.org
Thu Oct 29 02:23:01 PDT 2026


FireBurn wrote:

It is not applications storing an address in a struct sockaddr. The kernel's own header does it: sockaddr_vm in linux/vm_sockets.h computes its padding as sizeof(struct sockaddr) minus the fields before it, and with a one byte sa_data that underflows to an array of 2^64 elements, so the header does not compile. Fourteen bytes is what the kernel, glibc and musl all give it

You are right that it still doesn't fit IPv6 or unix addresses, and it isn't meant to. Those go through their own structures or sockaddr_storage


https://github.com/llvm/llvm-project/pull/236518


More information about the libc-commits mailing list