public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, "Arnd Bergmann" <arnd@arndb.de>,
	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" <carlos@redhat.com>,
	"Adhemerval Zanella" <adhemerval.zanella@linaro.org>,
	"Rich Felker" <dalias@libc.org>,
	klibc@zytor.com, "Florian Weimer" <fweimer@redhat.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Kuniyuki Iwashima" <kuniyu@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Willem de Bruijn" <willemb@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Simon Horman" <horms@kernel.org>,
	"Shuah Khan" <shuah@kernel.org>,
	"Mat Martineau" <martineau@kernel.org>,
	"Geliang Tang" <geliang@kernel.org>,
	"Mickaël Salaün" <mic@digikod.net>,
	"Günther Noack" <gnoack@google.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Song Liu" <song@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"KP Singh" <kpsingh@kernel.org>, "Hao Luo" <haoluo@google.com>,
	"Jiri Olsa" <jolsa@kernel.org>
Subject: Re: [PATCH net-next v2 1/4] selftests: net: Move some UAPI header inclusions after libc ones
Date: Mon, 26 Jan 2026 19:13:50 +0100	[thread overview]
Message-ID: <4e673f7f-c49c-46b0-85b4-bae6e4efcb3a@kernel.org> (raw)
In-Reply-To: <20260120-uapi-sockaddr-v2-1-63c319111cf6@linutronix.de>

Hi Thomas,

On 20/01/2026 15:10, Thomas Weißschuh wrote:
> 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.

Thank you for looking at this!

Here is my (late, sorry) review for the modifications related to MPTCP:
> 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 <linux/sock_diag.h>
> -#include <linux/rtnetlink.h>
> -#include <linux/inet_diag.h>
> -#include <linux/netlink.h>
> -#include <linux/compiler.h>
>  #include <sys/socket.h>
>  #include <netinet/in.h>
>  #include <linux/tcp.h>

There is a remaining one (linux/tcp.h) here that you might want to move
below too.

> @@ -17,6 +12,12 @@
>  #include <errno.h>
>  #include <stdio.h>
>  
> +#include <linux/sock_diag.h>
> +#include <linux/rtnetlink.h>
> +#include <linux/inet_diag.h>
> +#include <linux/netlink.h>
> +#include <linux/compiler.h>

Note that I just noticed this is the only file from this directory where
the "includes" are not sorted by type and alphabetical order, see
pm_nl_ctl.c as an example. A bit of a detail, but if you plan to send a
v2, do you mind doing that too here while at it, please?

If not, I can look at that later, but better to avoid doing that in
parallel.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2026-01-26 18:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 14:10 [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr' Thomas Weißschuh
2026-01-20 14:10 ` [PATCH net-next v2 1/4] selftests: net: Move some UAPI header inclusions after libc ones Thomas Weißschuh
2026-01-26 18:13   ` Matthieu Baerts [this message]
2026-01-30 10:22     ` Thomas Weißschuh
2026-01-30 10:39       ` Matthieu Baerts
2026-01-20 14:10 ` [PATCH net-next v2 2/4] selftests/landlock: " Thomas Weißschuh
2026-01-20 21:46   ` Mickaël Salaün
2026-01-20 14:10 ` [PATCH net-next v2 3/4] samples/bpf: " Thomas Weißschuh
2026-01-20 14:10 ` [PATCH net-next v2 4/4] net: uapi: Provide an UAPI definition of 'struct sockaddr' Thomas Weißschuh
2026-01-22  3:27 ` [PATCH net-next v2 0/4] " Jakub Kicinski
2026-01-30 10:34   ` Thomas Weißschuh
2026-01-30 16:17     ` Jakub Kicinski
2026-01-31 10:26       ` Thomas Weißschuh
2026-01-31 17:25         ` Jakub Kicinski
2026-02-03 11:42           ` Thomas Weißschuh
2026-02-03 22:40             ` Jakub Kicinski
2026-02-04  5:51               ` Thomas Weißschuh
2026-02-05  1:55                 ` Jakub Kicinski
2026-02-09 13:34                   ` Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e673f7f-c49c-46b0-85b4-bae6e4efcb3a@kernel.org \
    --to=matttbe@kernel.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=andrii@kernel.org \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=carlos@redhat.com \
    --cc=dalias@libc.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=fweimer@redhat.com \
    --cc=geliang@kernel.org \
    --cc=gnoack@google.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=klibc@zytor.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=martineau@kernel.org \
    --cc=mic@digikod.net \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=willemb@google.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox