Commit 7335d4ac authored by Cong Liu's avatar Cong Liu Committed by Jakub Kicinski
Browse files

selftests: mptcp: fix incorrect fd checks in main_loop



Fix a bug where the code was checking the wrong file descriptors
when opening the input files. The code was checking 'fd' instead
of 'fd_in', which could lead to incorrect error handling.

Fixes: 05be5e27 ("selftests: mptcp: add disconnect tests")
Cc: stable@vger.kernel.org
Fixes: ca7ae891 ("selftests: mptcp: mptfo Initiator/Listener")
Co-developed-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarCong Liu <liucong2@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/20250328-net-mptcp-misc-fixes-6-15-v1-2-34161a482a7f@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 443041de
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1270,7 +1270,7 @@ int main_loop(void)

	if (cfg_input && cfg_sockopt_types.mptfo) {
		fd_in = open(cfg_input, O_RDONLY);
		if (fd < 0)
		if (fd_in < 0)
			xerror("can't open %s:%d", cfg_input, errno);
	}

@@ -1293,7 +1293,7 @@ int main_loop(void)

	if (cfg_input && !cfg_sockopt_types.mptfo) {
		fd_in = open(cfg_input, O_RDONLY);
		if (fd < 0)
		if (fd_in < 0)
			xerror("can't open %s:%d", cfg_input, errno);
	}