* [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg
@ 2025-04-07 7:53 Geliang Tang
2025-04-07 9:13 ` MPTCP CI
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2025-04-07 7:53 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
It's strange that 'nlh' variable is set to NULL in get_mptcpinfo() and then
this NULL pointer is passed to recv_nlmsg(). In fact, this variable should
be defined in recv_nlmsg(), not get_mptcpinfo().
So this patch drops this useless 'nlh' parameter of recv_nlmsg() and define
'nlh' variable in recv_nlmsg().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
tools/testing/selftests/net/mptcp/mptcp_diag.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_diag.c b/tools/testing/selftests/net/mptcp/mptcp_diag.c
index 284286c524cf..37d5015ad08c 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_diag.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_diag.c
@@ -185,9 +185,10 @@ static void parse_nlmsg(struct nlmsghdr *nlh)
}
}
-static void recv_nlmsg(int fd, struct nlmsghdr *nlh)
+static void recv_nlmsg(int fd)
{
char rcv_buff[8192];
+ struct nlmsghdr *nlh = (struct nlmsghdr *)rcv_buff;
struct sockaddr_nl rcv_nladdr = {
.nl_family = AF_NETLINK
};
@@ -204,7 +205,6 @@ static void recv_nlmsg(int fd, struct nlmsghdr *nlh)
int len;
len = recvmsg(fd, &rcv_msg, 0);
- nlh = (struct nlmsghdr *)rcv_buff;
while (NLMSG_OK(nlh, len)) {
if (nlh->nlmsg_type == NLMSG_DONE) {
@@ -225,7 +225,6 @@ static void recv_nlmsg(int fd, struct nlmsghdr *nlh)
static void get_mptcpinfo(__u32 token)
{
- struct nlmsghdr *nlh = NULL;
int fd;
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);
@@ -233,7 +232,7 @@ static void get_mptcpinfo(__u32 token)
die_perror("Netlink socket");
send_query(fd, token);
- recv_nlmsg(fd, nlh);
+ recv_nlmsg(fd);
close(fd);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg
2025-04-07 7:53 [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg Geliang Tang
@ 2025-04-07 9:13 ` MPTCP CI
2025-04-10 17:39 ` Matthieu Baerts
2025-04-10 17:44 ` Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: MPTCP CI @ 2025-04-07 9:13 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/14304160762
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/aead1761a001
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=950398
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg
2025-04-07 7:53 [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg Geliang Tang
2025-04-07 9:13 ` MPTCP CI
@ 2025-04-10 17:39 ` Matthieu Baerts
2025-04-10 17:44 ` Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2025-04-10 17:39 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 07/04/2025 09:53, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> It's strange that 'nlh' variable is set to NULL in get_mptcpinfo() and then
> this NULL pointer is passed to recv_nlmsg(). In fact, this variable should
> be defined in recv_nlmsg(), not get_mptcpinfo().
>
> So this patch drops this useless 'nlh' parameter of recv_nlmsg() and define
> 'nlh' variable in recv_nlmsg().
Indeed, that is better like that.
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg
2025-04-07 7:53 [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg Geliang Tang
2025-04-07 9:13 ` MPTCP CI
2025-04-10 17:39 ` Matthieu Baerts
@ 2025-04-10 17:44 ` Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2025-04-10 17:44 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 07/04/2025 09:53, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> It's strange that 'nlh' variable is set to NULL in get_mptcpinfo() and then
> this NULL pointer is passed to recv_nlmsg(). In fact, this variable should
> be defined in recv_nlmsg(), not get_mptcpinfo().
>
> So this patch drops this useless 'nlh' parameter of recv_nlmsg() and define
> 'nlh' variable in recv_nlmsg().
Now in our tree:
New patches for t/upstream:
- 65056576ab07: selftests: mptcp: diag: drop nlh parameter of recv_nlmsg
- Results: 244c301d3de6..d16892726caa (export)
Tests are now in progress:
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/5b28c8bf763dc38db8b1e81e3222a3a16e49bb36/checks
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-10 17:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 7:53 [PATCH mptcp-next] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg Geliang Tang
2025-04-07 9:13 ` MPTCP CI
2025-04-10 17:39 ` Matthieu Baerts
2025-04-10 17:44 ` Matthieu Baerts
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.