The historically fixed-size struct sockaddr is part of UAPI and embedded in many existing structures. The kernel uses struct sockaddr extensively within the kernel to represent arbitrarily sized sockaddr structures, which caused problems with the compiler's ability to determine object sizes correctly. The "temporary" solution was to make sockaddr explicitly use a flexible array, but this causes problems for embedding struct sockaddr in structures, where once again the compiler has to guess about the size of such objects, and causes thousands of warnings under the coming -Wflex-array-member-not-at-end warning.
Switching to sockaddr_storage internally everywhere wastes a lot of memory, so we are left with needing two changes: - introduction of an explicitly arbitrarily sized sockaddr struct - switch struct sockaddr back to being fixed size
Doing the latter step requires all "arbitrarily sized" uses of struct sockaddr to be replaced with the new struct from the first step.
So, introduce the new struct and do enough conversions that we can switch sockaddr back to a fixed-size sa_data. ====================
Link: https://patch.msgid.link/20251104002608.do.383-kees@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>