Skip to content

Commit

Permalink
Squash to "selftests/bpf: Add mptcp subflow subtest"
Browse files Browse the repository at this point in the history
Close client_fd as Martin suggested.

Please update my email address of this patch squashed to as:

  From: Geliang Tang <[email protected]>

since BPF CI complained about it:

WARNING: From:/Signed-off-by: email address mismatch: 'From: Geliang Tang <[email protected]>' != 'Signed-off-by: Geliang Tang <[email protected]>'

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Aug 20, 2024
1 parent c65deb8 commit 013dd62
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,20 @@ static void run_subflow(char *new)
{
int server_fd, client_fd, err;
char cc[TCP_CA_NAME_MAX];
socklen_t len = sizeof(cc);
socklen_t len;

server_fd = start_mptcp_server(AF_INET, ADDR_1, PORT_1, 0);
if (!ASSERT_GE(server_fd, 0, "start_mptcp_server"))
return;

client_fd = connect_to_fd(server_fd, 0);
if (!ASSERT_GE(client_fd, 0, "connect to fd"))
goto fail;
goto close_server;

len = sizeof(cc);
err = getsockopt(server_fd, SOL_TCP, TCP_CONGESTION, cc, &len);
if (!ASSERT_OK(err, "getsockopt(srv_fd, TCP_CONGESTION)"))
goto fail;
if (!ASSERT_OK(err, "getsockopt(server_fd, TCP_CONGESTION)"))
goto close_client;

send_byte(client_fd);

Expand All @@ -404,8 +405,9 @@ static void run_subflow(char *new)
ASSERT_OK(ss_search(ADDR_1, new), "ss_search new cc");
ASSERT_OK(ss_search(ADDR_2, cc), "ss_search default cc");

close_client:
close(client_fd);
fail:
close_server:
close(server_fd);
}

Expand Down

0 comments on commit 013dd62

Please sign in to comment.