From nobody Mon Jan 26 01:48:55 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AA82500940; Tue, 20 Jan 2026 14:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; cv=none; b=FdvIoOgpHbdp57WsOJXCO//4rFWALMecvrYmpUj/GyVr3HBqMfwVSgpQ8wMcsBncuWqn490LLXIxa4t2kFvrQwY+VRMNg6YjprL+HF4ZDooG14hAD9x/Jgg7D+uQR8Gjw8APQE1tqUlxtQpNpBEU6IQV9qeJzDv8aD3edjSJQ8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; c=relaxed/simple; bh=NL2NiPJiVOXGlDSPX/IXGVFv3gZqRodtnl63WyHlrT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xrm++7RxC0Em3RiWpH6rlu+9a9eX8ihfykwiaKmuG77ONR1fI4CZoZyVJYKqKlH7gtI5TWw6pNUQBOks4I+JgKkCWeuDKJykLXHp8KH7VAWvCi+zXDY0MQcAC8gYEnWR0+qD1d1K8VLzaRxkM4c/cVeAryGrsrgZQ1CJVz9SCYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QVf5JIqw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RJuRitW1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QVf5JIqw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RJuRitW1" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nu42fbo/KTwWbTEJNSfohypBk88voIUWzFlL0jg8Asc=; b=QVf5JIqwol6mD0wSHtGINS/EN7+SG1TaEysglbq9pi9jkITL/Re6B8r9X9x+lyNMsRqpr+ 8XrMkTgdTEMUkLM7sG25qiqfsjXPXILaLxUPkLqs52GkMbuftElrt8h5Drpp8hcFEbZXPG /l0Ip8WnVMNiGYJW7keA34hVfcfLNEU/+kvuEEhZY8PIGxociJ7gyB7cQDJUbrn9MoK+LX uLuDbu849BBC73+/qR2YZyQtxWhx1C1CbOcSbukm0RFVtcDlZ2SDYlZ0kbhUQhjE+B1rEJ +8UInYr5n8/ESscYa9Cd16etJGdVkxKTNhXenTkKtKmmdrQWx9ps+uluO9a0gw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nu42fbo/KTwWbTEJNSfohypBk88voIUWzFlL0jg8Asc=; b=RJuRitW17NsGCwZrxdyALTxa2Sop4NEm7M4/2D1lY0J5eoYWa1sEGUUHeaCOAJEb0w0nD3 s37/9rX4lucFajCQ== Date: Tue, 20 Jan 2026 15:10:33 +0100 Subject: [PATCH net-next v2 3/4] samples/bpf: Move some UAPI header inclusions after libc ones Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-uapi-sockaddr-v2-3-63c319111cf6@linutronix.de> References: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> In-Reply-To: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> To: Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Shuah Khan , Matthieu Baerts , Mat Martineau , Geliang Tang , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , linux-kselftest@vger.kernel.org, mptcp@lists.linux.dev, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, libc-alpha@sourceware.org, Carlos O'Donell , Adhemerval Zanella , Rich Felker , klibc@zytor.com, Florian Weimer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1768918237; l=4542; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=NL2NiPJiVOXGlDSPX/IXGVFv3gZqRodtnl63WyHlrT8=; b=eZBfbm8KV848zvW+Ku4Kfcq+zHdcVueYyOFWcMEHikDcFpOV2a627C4aKg6x8k5ZhHbg+N5yr +2ISIHCy3/1CwGRF/P2J+p4PIl3ac4MZGzF0g/1GdroJVysJyzTzpnF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Interleaving inclusions of UAPI headers and libc headers is problematic. Both sets of headers define conflicting symbols. To enable their coexistence a compatibility-mechanism is in place. An upcoming change will define 'struct sockaddr' from linux/socket.h. However sys/socket.h from libc does not yet handle this case and a symbol conflict will arise. Move the inclusion of all UAPI headers after the inclusion of the glibc ones, so the compatibility mechanism from the UAPI headers is used. Signed-off-by: Thomas Wei=C3=9Fschuh --- 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 ++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/samples/bpf/xdp_adjust_tail_user.c b/samples/bpf/xdp_adjust_ta= il_user.c index e9426bd65420..32d00405debc 100644 --- a/samples/bpf/xdp_adjust_tail_user.c +++ b/samples/bpf/xdp_adjust_tail_user.c @@ -5,8 +5,6 @@ * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ -#include -#include #include #include #include @@ -18,9 +16,13 @@ #include #include #include + #include #include =20 +#include +#include + #define STATS_INTERVAL_S 2U #define MAX_PCKT_SIZE 600 =20 diff --git a/samples/bpf/xdp_fwd_user.c b/samples/bpf/xdp_fwd_user.c index 193b3b79b31f..ca55f3eac12a 100644 --- a/samples/bpf/xdp_fwd_user.c +++ b/samples/bpf/xdp_fwd_user.c @@ -11,9 +11,6 @@ * General Public License for more details. */ =20 -#include -#include -#include #include #include #include @@ -27,6 +24,10 @@ #include #include =20 +#include +#include +#include + static __u32 xdp_flags =3D XDP_FLAGS_UPDATE_IF_NOEXIST; =20 static int do_attach(int idx, int prog_fd, int map_fd, const char *name) diff --git a/samples/bpf/xdp_router_ipv4_user.c b/samples/bpf/xdp_router_ip= v4_user.c index 266fdd0b025d..2abc7d294251 100644 --- a/samples/bpf/xdp_router_ipv4_user.c +++ b/samples/bpf/xdp_router_ipv4_user.c @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2017 Cavium, Inc. */ -#include -#include -#include #include #include #include @@ -25,6 +22,9 @@ #include #include #include +#include +#include +#include #include "xdp_sample_user.h" #include "xdp_router_ipv4.skel.h" =20 diff --git a/samples/bpf/xdp_sample_user.c b/samples/bpf/xdp_sample_user.c index 158682852162..d9aec2bd372c 100644 --- a/samples/bpf/xdp_sample_user.c +++ b/samples/bpf/xdp_sample_user.c @@ -7,13 +7,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -32,6 +25,14 @@ #include #include =20 +#include +#include +#include +#include +#include +#include +#include + #include "bpf_util.h" #include "xdp_sample_user.h" =20 diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunn= el_user.c index 7e4b2f7108a6..e9503036d0a0 100644 --- a/samples/bpf/xdp_tx_iptunnel_user.c +++ b/samples/bpf/xdp_tx_iptunnel_user.c @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2016 Facebook */ -#include -#include #include #include #include @@ -16,6 +14,8 @@ #include #include #include +#include +#include #include "bpf_util.h" #include "xdp_tx_iptunnel_common.h" =20 --=20 2.52.0