From patchwork Tue Jan 20 14:10:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 128578 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id EE10A4BC7EC6 for ; Tue, 20 Jan 2026 14:14:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE10A4BC7EC6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=QVf5JIqw; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=RJuRitW1 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by sourceware.org (Postfix) with ESMTPS id 1A9104BC0568 for ; Tue, 20 Jan 2026 14:10:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A9104BC0568 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linutronix.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A9104BC0568 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a0a:51c0:0:12e:550::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768918242; cv=none; b=CXBVJrtq7l4a5yzrglbBkzPoqQdk+smpgVv1CYop5hXxQ30eDFAmQjNvVWYH2gQpxhXq61qmc/GxO072jST2KL9UtNrY0KzUXhmyM4krI+F7n6cNpThHhN2OJdBsZO1QKijcEGT1hW7h9PD0DZm6gDU0Rcn1lcp7EX9ClPhU+jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768918242; c=relaxed/simple; bh=NL2NiPJiVOXGlDSPX/IXGVFv3gZqRodtnl63WyHlrT8=; h=From:DKIM-Signature:DKIM-Signature:Date:Subject:MIME-Version: Message-Id:To; b=jRn+9RPJQpxdaKGOx/riH4xBnNdPJeI/7euG4xdhS2RGLD8Yi0Up57UwRpgPhuOvrmD4V8A/laE9cSSEphmL0PbeA3RmQx//p1PS9UUdmLYKukgGaMRm3hclRPSpCzyLzzRZmjeoMbdT2CTGIcAR9SKXIdEWM3WDIKj/Ze82JU0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A9104BC0568 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 MIME-Version: 1.0 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=BCnt?= =?utf-8?q?her_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= X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org 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ßschuh --- 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_tail_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 +#include +#include + #define STATS_INTERVAL_S 2U #define MAX_PCKT_SIZE 600 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. */ -#include -#include -#include #include #include #include @@ -27,6 +24,10 @@ #include #include +#include +#include +#include + static __u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST; 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_ipv4_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" 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 +#include +#include +#include +#include +#include +#include +#include + #include "bpf_util.h" #include "xdp_sample_user.h" diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunnel_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"