Skip to content

Commit

Permalink
fix2
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang committed Oct 22, 2024
1 parent cf9a278 commit 2d445c1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ static int get_events_line(char *type, char *line)
return 0;
}

static int wait_for_token(void)
static int wait_for_token(int fd)
{
char line[1024], *str;
__u32 token;
Expand All @@ -686,6 +686,7 @@ static int wait_for_token(void)
for (i = 0; i < 10; i++) {
SYS(fail, "ip netns exec %s echo sleep 0.2 s", NS_TEST);
usleep(200000); /* 0.2s */
send_byte(fd);

sync();
if (get_events_line("type:2", line))
Expand Down Expand Up @@ -742,9 +743,7 @@ static void run_iters_address(void)
if (!ASSERT_OK_FD(accept_fd, "accept"))
goto close_client;

usleep(200000); /* 0.2s */
send_byte(client_fd);
token = wait_for_token();
token = wait_for_token(client_fd);
if (!token)
goto close_client;
recv_byte(accept_fd);
Expand Down Expand Up @@ -926,9 +925,7 @@ static void run_userspace_pm(enum mptcp_pm_family family)
if (!ASSERT_OK_FD(accept_fd, "accept"))
goto close_client;

usleep(200000); /* 0.2s */
send_byte(client_fd);
token = wait_for_token();
token = wait_for_token(client_fd);
if (!token)
goto close_client;
recv_byte(accept_fd);
Expand Down

0 comments on commit 2d445c1

Please sign in to comment.