From patchwork Tue Jan 20 14:10:31 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: 128575 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 5A3B24BA9026 for ; Tue, 20 Jan 2026 14:12:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A3B24BA9026 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=rtlQ7SdG; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=QDVif8ks X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by sourceware.org (Postfix) with ESMTPS id 2A4CA4BA9026 for ; Tue, 20 Jan 2026 14:10:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A4CA4BA9026 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 2A4CA4BA9026 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768918241; cv=none; b=xLZQlfJChBZkTElfrHggUfet1q+4+AAM8w/RErvfgAhwQw7pF5DsvQK3GioqQQJ8t3omR+6jo6V6oZFjGcVjsZ7P1TON4PpVqVp+aoBTU+WvZ6XtdyuS/IhOG/0DhPTY3JMI4b4fJyTnKEb5/PA0dZ6FPOmBmYIGEZlrKd7Tsjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768918241; c=relaxed/simple; bh=ZqrmLjkMijbcJc3IQS7wKin/D1t2uoZP1sLY/xgFZdI=; h=From:DKIM-Signature:DKIM-Signature:Date:Subject:MIME-Version: Message-Id:To; b=nT5INsHBELOD4rj2bzNPTrh/jNy2dbb+7gEgbDtbEJEvZQjltjeuqXnYvcSKuOipf6TaiL0SzrU74mp6J3gr3sqD1ihT12QJh8TJ1CE2AjcC/+Fphnto5NZ2IvjsNiT1zKTA4yFqX+2wqw32F0eTczqAs1YcTsqfjo367XwhoEQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A4CA4BA9026 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918239; 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=qWWbJ6p/llOOq5uee8jczRuLvKm3RcJ6H6cwpERIvT8=; b=rtlQ7SdGTkp2BTbujdjmEMG4e8L4Y54KOJneDOwznalZgT0PCYNs3Y7xdC4GP1s42jFqvs OYVawGSSlmqmXaIvnte9k+7J1aO6Qc47KMMsNqYUKbHgxQy4q1vr/1B+opOMeHb13i+/Cf 57oGOwhSZP2sR5+qi6Hgy2dsGiAEvuERgBSDCO7W+Ar0fGc6BNFyE+ouDiRNAx5LGInA8U jBl9fC39QCqOOM2R8VcWrmIjz0j+XlXhpttFqtZXNU47Dvj7WLfTsYSpjvZpCml4rWwxE7 CTwlIaeVPVDGIfl05o6I1wzXGuzcXRh19tkbc4sQ4pL5yeFeZXsY8dbo0dJTAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918239; 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=qWWbJ6p/llOOq5uee8jczRuLvKm3RcJ6H6cwpERIvT8=; b=QDVif8kseiztc2+rY9NVDDg7G+ZgDVwdgyTTLRKXpOMyi8AOJaTvACt3+qnfEDXcNeaEU6 k8z+R2493jKfd/CQ== Date: Tue, 20 Jan 2026 15:10:31 +0100 Subject: [PATCH net-next v2 1/4] selftests: net: Move some UAPI header inclusions after libc ones MIME-Version: 1.0 Message-Id: <20260120-uapi-sockaddr-v2-1-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=6177; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ZqrmLjkMijbcJc3IQS7wKin/D1t2uoZP1sLY/xgFZdI=; b=ckR5DvB2GszhHGd1qq5KB7GFMoHcqBtMFjspRoVG+3U1BvA4ONTzZ+DkdODqiPl1YQjsYLnrJ xEOvtkyVbdVB683EKZ0pv2XTMRcvDWNfqC1o0UKdWbg5B2QzJsgEYxc X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-Spam-Status: No, score=-10.9 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, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_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. Furthermore libc-compat.h evaluates the state of the libc inclusions only once, at the point it is included first. If another problematic header from libc is included later, symbol conflicts arise. This will trigger other duplicate definitions when linux/libc-compat.h is added to linux/socket.h Move the inclusion of UAPI headers after the inclusion of the glibc ones, so the libc-compat.h continues to work correctly. Signed-off-by: Thomas Weißschuh --- 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 +++-- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/net/af_unix/diag_uid.c b/tools/testing/selftests/net/af_unix/diag_uid.c index da7d50cedee6..05456a205325 100644 --- a/tools/testing/selftests/net/af_unix/diag_uid.c +++ b/tools/testing/selftests/net/af_unix/diag_uid.c @@ -5,15 +5,16 @@ #include #include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include + #include "kselftest_harness.h" FIXTURE(diag_uid) diff --git a/tools/testing/selftests/net/busy_poller.c b/tools/testing/selftests/net/busy_poller.c index 3a81f9c94795..34bd8d28808a 100644 --- a/tools/testing/selftests/net/busy_poller.c +++ b/tools/testing/selftests/net/busy_poller.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -19,6 +18,8 @@ #include #include +#include + #include #include diff --git a/tools/testing/selftests/net/mptcp/mptcp_diag.c b/tools/testing/selftests/net/mptcp/mptcp_diag.c index 8e0b1b8d84b6..af25ebfd2915 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_diag.c +++ b/tools/testing/selftests/net/mptcp/mptcp_diag.c @@ -1,11 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2025, Kylin Software */ -#include -#include -#include -#include -#include #include #include #include @@ -17,6 +12,12 @@ #include #include +#include +#include +#include +#include +#include + #ifndef IPPROTO_MPTCP #define IPPROTO_MPTCP 262 #endif diff --git a/tools/testing/selftests/net/nettest.c b/tools/testing/selftests/net/nettest.c index 1f5227f3d64d..71430403b50b 100644 --- a/tools/testing/selftests/net/nettest.c +++ b/tools/testing/selftests/net/nettest.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include #include @@ -30,6 +28,8 @@ #include #include +#include +#include #include #include #include diff --git a/tools/testing/selftests/net/tcp_ao/icmps-discard.c b/tools/testing/selftests/net/tcp_ao/icmps-discard.c index 85c1a1e958c6..451ba89914c9 100644 --- a/tools/testing/selftests/net/tcp_ao/icmps-discard.c +++ b/tools/testing/selftests/net/tcp_ao/icmps-discard.c @@ -16,12 +16,12 @@ * Author: Dmitry Safonov */ #include -#include -#include -#include #include #include #include +#include +#include +#include #include "aolib.h" #include "../../../../include/linux/compiler.h" diff --git a/tools/testing/selftests/net/tcp_ao/lib/netlink.c b/tools/testing/selftests/net/tcp_ao/lib/netlink.c index 7f108493a29a..69a05820782a 100644 --- a/tools/testing/selftests/net/tcp_ao/lib/netlink.c +++ b/tools/testing/selftests/net/tcp_ao/lib/netlink.c @@ -1,14 +1,15 @@ // SPDX-License-Identifier: GPL-2.0 /* Original from tools/testing/selftests/net/ipsec.c */ -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include + #include "aolib.h" #define MAX_PAYLOAD 2048 diff --git a/tools/testing/selftests/net/tun.c b/tools/testing/selftests/net/tun.c index 0efc67b0357a..e6e4c52d538e 100644 --- a/tools/testing/selftests/net/tun.c +++ b/tools/testing/selftests/net/tun.c @@ -8,12 +8,13 @@ #include #include #include +#include +#include + #include #include #include #include -#include -#include #include "kselftest_harness.h"