Commit caa6811c authored by Gang Yan's avatar Gang Yan Committed by Jakub Kicinski
Browse files

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: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarGang Yan <yangang@kylinos.cn>
Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarMatthieu 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: default avatarJakub Kicinski <kuba@kernel.org>
parent 3fea468d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment