Skip to content

Commit 7335d4a

Browse files
Cong Liukuba-moo
authored andcommitted
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: 05be5e2 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Fixes: ca7ae89 ("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>
1 parent 443041d commit 7335d4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/mptcp/mptcp_connect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ int main_loop(void)
12701270

12711271
if (cfg_input && cfg_sockopt_types.mptfo) {
12721272
fd_in = open(cfg_input, O_RDONLY);
1273-
if (fd < 0)
1273+
if (fd_in < 0)
12741274
xerror("can't open %s:%d", cfg_input, errno);
12751275
}
12761276

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

12941294
if (cfg_input && !cfg_sockopt_types.mptfo) {
12951295
fd_in = open(cfg_input, O_RDONLY);
1296-
if (fd < 0)
1296+
if (fd_in < 0)
12971297
xerror("can't open %s:%d", cfg_input, errno);
12981298
}
12991299

0 commit comments

Comments
 (0)