From: sashiko-bot@kernel.org
To: zibuyu <zibuyu423@gmail.com>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next] selftests: mptcp: cover mixed accepts on one listener
Date: Thu, 03 Dec 2026 09:54:42 +0000 [thread overview]
Message-ID: <sashiko-outbox-247509@kernel.org> (raw)
In-Reply-To: <20261203094509.3382752-1-zibuyu423@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests: mptcp: UAPI linux/kernel.h shadows ARRAY_SIZE and
breaks build
--
commit aa719ae60eaeb0cc26e571bc88875f675f4fdba7
Author: zibuyu <zibuyu423@gmail.com>
selftests: mptcp: cover mixed accepts on one listener
This commit adds test_mixed_accept() to mptcp_sockopt.c to connect MPTCP,
TCP, and MPTCP clients to the same listener and verify SO_PROTOCOL and
client data on each accepted socket.
Link: https://github.com/multipath-tcp/mptcp_net-next/issues/426
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> index b8158a1198eba..cb3e8b2e0b8eb 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> @@ -26,6 +26,7 @@
>
> #include <linux/tcp.h>
> #include <linux/compiler.h>
> +#include <linux/kernel.h>
>
> static int pf = AF_INET;
>
> @@ -705,22 +706,49 @@ static int xaccept(int s)
> return fd;
> }
>
> -static int server(int pipefd)
> +static void test_mixed_accept(int listener, const char *addr, const char *port)
> {
> - int fd = -1, r;
> + static const int protos[] = { IPPROTO_MPTCP, IPPROTO_TCP, IPPROTO_MPTCP };
> + int clients[ARRAY_SIZE(protos)], accepted[ARRAY_SIZE(protos)];
[Severity: Medium]
Can #include <linux/kernel.h> fail to provide ARRAY_SIZE() when UAPI headers
are installed, breaking the mptcp_sockopt build?
tools/testing/selftests/net/mptcp/Makefile puts -I$(top_srcdir)/usr/include
ahead of -I$(top_srcdir)/tools/include:
tools/testing/selftests/net/mptcp/Makefile:
CFLAGS += -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
CFLAGS += -I$(top_srcdir)/tools/include
When UAPI headers are installed (for example via make kselftest),
#include <linux/kernel.h> resolves to $(top_srcdir)/usr/include/linux/kernel.h
instead of tools/include/linux/kernel.h. The UAPI header does not define
ARRAY_SIZE(), so compiling mptcp_sockopt.c fails in test_mixed_accept().
Including kselftest.h instead of linux/kernel.h would provide ARRAY_SIZE()
without colliding with the UAPI header.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203094509.3382752-1-zibuyu423@gmail.com?part=1
next prev parent reply other threads:[~2026-12-03 9:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 9:45 [PATCH mptcp-next] selftests: mptcp: cover mixed accepts on one listener zibuyu
2026-12-03 9:54 ` sashiko-bot [this message]
2026-12-03 11:06 ` MPTCP CI
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=sashiko-outbox-247509@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zibuyu423@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.