Skip to content

Commit

Permalink
wip: use ss with -n
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
  • Loading branch information
matttbe committed Jan 15, 2024
1 parent 8884a71 commit 7d8268d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static int has_bytes_sent(char *addr)
{
char cmd[128];

snprintf(cmd, sizeof(cmd), "ip netns exec %s ss -itp src %s sport %d dst %s | %s",
snprintf(cmd, sizeof(cmd), "ip netns exec %s ss -tipn src %s sport %d dst %s | %s",
NS_TEST, ADDR_1, PORT_1, addr, "grep -q bytes_sent:");
return system(cmd);
}
Expand Down
8 changes: 4 additions & 4 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1883,9 +1883,9 @@ chk_subflows_total()
print_check "$info $1:$2"

# if not, count the TCP connections that are in fact MPTCP subflows
cnt1=$(ss -N $ns1 -tip state established state syn-sent state syn-recv |
cnt1=$(ss -N $ns1 -tipn state established state syn-sent state syn-recv |
grep -c tcp-ulp-mptcp)
cnt2=$(ss -N $ns2 -tip state established state syn-sent state syn-recv |
cnt2=$(ss -N $ns2 -tipn state established state syn-sent state syn-recv |
grep -c tcp-ulp-mptcp)

if [ "$1" != "$cnt1" ] || [ "$2" != "$cnt2" ]; then
Expand All @@ -1896,8 +1896,8 @@ chk_subflows_total()
fi

if [ "$dump_stats" = 1 ]; then
ss -N $ns1 -tip
ss -N $ns2 -tip
ss -N $ns1 -tipn
ss -N $ns2 -tipn
fi
}

Expand Down

0 comments on commit 7d8268d

Please sign in to comment.