selftests: mptcp: close server file descriptors

The server file descriptor ('fd') is opened in server() but never closed.
While accepted connections are properly closed in process_one_client(),
the main listening socket remains open, causing a resource leak.

This patch ensures the server fd is properly closed after processing
clients, bringing the sockopt and inq test cases in line with proper
resource cleanup practices.

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250912-net-next-mptcp-minor-fixes-6-18-v1-1-99d179b483ad@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Geliang Tang 2025-09-12 18:36:47 +02:00 committed by Jakub Kicinski
parent f3b52167a0
commit dab86ee688
2 changed files with 2 additions and 0 deletions

View File

@ -502,6 +502,7 @@ static int server(int unixfd)
process_one_client(r, unixfd);
close(fd);
return 0;
}

View File

@ -722,6 +722,7 @@ static int server(int pipefd)
process_one_client(r, pipefd);
close(fd);
return 0;
}