]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: mptcp: close server IPC descriptors
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 12 Sep 2025 16:36:48 +0000 (18:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 16 Sep 2025 01:14:23 +0000 (18:14 -0700)
commite3241506a47175de74f65bc638e588b9f70dc105
treeb780053d67699049a8752cb8562fc4e2e6fc58da
parentdab86ee688ae03919648c871c603356818090797
selftests: mptcp: close server IPC descriptors

The client-side function connect_one_server() properly closes its IPC
descriptor after use, but the server-side code in both mptcp_sockopt.c
and mptcp_inq.c was missing corresponding close() calls for their IPC
descriptors, leaving file descriptors open unnecessarily.

This change ensures proper cleanup by:
1. Adding missing close(pipefds[0]/unixfds[0]) in server processes
2. Adding close(pipefds[1]/unixfds[1]) after server() function calls

This ensures both ends of the IPC pipe are properly closed in their
respective processes, preventing file descriptor leaks.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250912-net-next-mptcp-minor-fixes-6-18-v1-2-99d179b483ad@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_inq.c
tools/testing/selftests/net/mptcp/mptcp_sockopt.c