Subject: Re: [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr'

From: Jakub Kicinski <[email-masked]>
Date: Wed, 21 Jan 2026 19:27:29 -0800

On Tue, 20 Jan 2026 15:10:30 +0100 Thomas Weißschuh wrote:
> Various UAPI headers reference 'struct sockaddr'. Currently the
> definition of this struct is pulled in from the libc header
> sys/socket.h. This is problematic as it introduces a dependency
> on a full userspace toolchain.
> 
> Add a definition of 'struct sockaddr' to the UAPI headers.
> Before that, reorder some problematic header inclusions in the selftests.

>  include/linux/socket.h                             | 10 ----------
>  include/uapi/linux/if.h                            |  4 ----
>  include/uapi/linux/libc-compat.h                   | 12 ++++++++++++
>  include/uapi/linux/socket.h                        | 14 ++++++++++++++
>  samples/bpf/xdp_adjust_tail_user.c                 |  6 ++++--
>  samples/bpf/xdp_fwd_user.c                         |  7 ++++---
>  samples/bpf/xdp_router_ipv4_user.c                 |  6 +++---
>  samples/bpf/xdp_sample_user.c                      | 15 ++++++++-------
>  samples/bpf/xdp_tx_iptunnel_user.c                 |  4 ++--
>  tools/testing/selftests/landlock/audit.h           |  7 ++++---
>  tools/testing/selftests/net/af_unix/diag_uid.c     |  9 +++++----
>  tools/testing/selftests/net/busy_poller.c          |  3 ++-
>  tools/testing/selftests/net/mptcp/mptcp_diag.c     | 11 ++++++-----
>  tools/testing/selftests/net/nettest.c              |  4 ++--
>  tools/testing/selftests/net/tcp_ao/icmps-discard.c |  6 +++---
>  tools/testing/selftests/net/tcp_ao/lib/netlink.c   |  9 +++++----
>  tools/testing/selftests/net/tun.c                  |  5 +++--
>  17 files changed, 77 insertions(+), 55 deletions(-)

Are all those selftests / samples getting broken by this patch set?

I understand that we should avoid libc dependencies in uAPI but at
least speaking for networking - building selftests without libc is..
not a practical proposition?