Skip to content

Commit b15e9c0

Browse files
matttbeintel-lab-lkp
authored andcommitted
selftests: mptcp: connect: catch IO errors on listen side
IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues. Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this. The main consequence of this issue is the error that was reported by the selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout. Now when an IO error is detected, the program exits directly with an error. Fixes: 05be5e2 ("selftests: mptcp: add disconnect tests") Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 27427f6 commit b15e9c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,8 @@ int main_loop_s(int listensock)
11121112
salen = sizeof(ss);
11131113
remotesock = accept(listensock, (struct sockaddr *)&ss, &salen);
11141114
if (remotesock >= 0) {
1115+
int err;
1116+
11151117
maybe_close(listensock);
11161118
check_sockaddr(pf, &ss, salen);
11171119
check_getpeername(remotesock, &ss, salen);
@@ -1125,7 +1127,9 @@ int main_loop_s(int listensock)
11251127
SOCK_TEST_TCPULP(remotesock, 0);
11261128

11271129
memset(&winfo, 0, sizeof(winfo));
1128-
copyfd_io(fd, remotesock, 1, true, &winfo);
1130+
err = copyfd_io(fd, remotesock, 1, true, &winfo);
1131+
if (err)
1132+
return err;
11291133
} else {
11301134
perror("accept");
11311135
return 1;

0 commit comments

Comments
 (0)