summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCong Liu <liucong2@kylinos.cn>2025-03-28 15:27:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-20 10:23:20 +0200
commit410a28539de7c7c77f778fb10ba904c26a3e6b4b (patch)
treed7eded63fd7c1eed78b1cc9a239a247bdc9d92dc /tools
parent2a9f24d1fe9d67c9ed1ca07c509085a911a850bf (diff)
downloadlinux-410a28539de7c7c77f778fb10ba904c26a3e6b4b.tar.gz
linux-410a28539de7c7c77f778fb10ba904c26a3e6b4b.tar.bz2
linux-410a28539de7c7c77f778fb10ba904c26a3e6b4b.zip
selftests: mptcp: fix incorrect fd checks in main_loop
commit 7335d4ac812917c16e04958775826d12d481c92d upstream. 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: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Fixes: ca7ae8916043 ("selftests: mptcp: mptfo Initiator/Listener") Co-developed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Cong Liu <liucong2@kylinos.cn> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu 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: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/mptcp/mptcp_connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
index 14851e1b185d..c83a8b47bbdf 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -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 @@ again:
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);
}