Commit dab86ee6 authored by Geliang Tang's avatar Geliang Tang Committed by Jakub Kicinski
Browse files

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: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Signed-off-by: default avatarMatthieu 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: default avatarJakub Kicinski <kuba@kernel.org>
parent f3b52167
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -502,6 +502,7 @@ static int server(int unixfd)

	process_one_client(r, unixfd);

	close(fd);
	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -722,6 +722,7 @@ static int server(int pipefd)

	process_one_client(r, pipefd);

	close(fd);
	return 0;
}