Skip to content

net: uapi: Provide an UAPI definition of 'struct sockaddr'

Thomas Weißschuh bpf linux-api linux-kselftest linux-security-module lkml mptcp netdev oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20251222-uapi-sockaddr-cf10e7624729

Versions newest first

  1. v2 Latest4 patches 15 repliesIn review
  2. v11 patch 14 repliesSuperseded

Changes in v2 from the cover letter

- Fix compilation failures in BPF samples and selftests
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4selftests: net: Move some UAPI header inclusions after libc onestools/testing/selftests/net/af_unix/diag_uid.c tools/testing/selftests/net/busy_poller.c tools/testing/selftests/net/mptcp/mptcp_diag.c +4 more+26 -213 replies
2/4selftests/landlock: Move some UAPI header inclusions after libc onestools/testing/selftests/landlock/audit.h+4 -31 reply
3/4samples/bpf: Move some UAPI header inclusions after libc onessamples/bpf/xdp_adjust_tail_user.c samples/bpf/xdp_fwd_user.c samples/bpf/xdp_router_ipv4_user.c +2 more+21 -170 replies
4/4net: uapi: Provide an UAPI definition of 'struct sockaddr'include/linux/socket.h include/uapi/linux/if.h include/uapi/linux/libc-compat.h +1 more+26 -140 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchMickaël Salaün
1/4
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

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

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.

---
Changes in v2:
- Fix compilation failures in BPF samples and selftests
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Thomas Weißschuh (4):
selftests: net: Move some UAPI header inclusions after libc ones selftests/landlock: Move some UAPI header inclusions after libc ones samples/bpf: Move some UAPI header inclusions after libc ones
net: uapi: Provide an UAPI definition of 'struct sockaddr'

 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(-)

---
base-commit: 24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7
change-id: 20251222-uapi-sockaddr-cf10e7624729

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>