]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: mptcp: refactor NLMSG handling with 'proto'
authorGang Yan <yangang@kylinos.cn>
Fri, 2 May 2025 12:29:25 +0000 (14:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 5 May 2025 23:52:00 +0000 (16:52 -0700)
commitcaa6811ccaed911f3b46e98b8e9f9d9c864d348e
tree47e16bf72cb16f4796333186da479d9d004f03ab
parent3fea468dca4f53fa0942661a0fc61dab8d6b0dc9
selftests: mptcp: refactor NLMSG handling with 'proto'

This patch introduces the '__u32 proto' variable to the 'send_query' and
'recv_nlmsg' functions for further extending function.

In the 'send_query' function, the inclusion of this variable makes the
structure clearer and more readable.

In the 'recv_nlmsg' function, the '__u32 proto' variable ensures that
the 'diag_info' field remains unmodified when processing IPPROTO_TCP data,
thereby preventing unintended transformation into 'mptcp_info' format.

While at it, increment iovlen directly when an item is added to simplify
this portion of the code and improve its readaility.

Co-developed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250502-net-next-mptcp-sft-inc-cover-v1-5-68eec95898fb@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_diag.c