From 7d8268d9af1ed8934c583bb3da13ffda56b083f3 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Mon, 15 Jan 2024 18:36:51 +0100 Subject: [PATCH] wip: use ss with -n Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 2 +- tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 122dcced7735f..bb78fe079f3df 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -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); } diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 6055cc98b4d8f..65c930b106b80 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -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 @@ -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 }