summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_sock_addr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/bpf/test_sock_addr.sh')
-rwxr-xr-xtools/testing/selftests/bpf/test_sock_addr.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_sock_addr.sh b/tools/testing/selftests/bpf/test_sock_addr.sh
index 9832a875a828..3b9fdb8094aa 100755
--- a/tools/testing/selftests/bpf/test_sock_addr.sh
+++ b/tools/testing/selftests/bpf/test_sock_addr.sh
@@ -4,7 +4,8 @@ set -eu
ping_once()
{
- ping -${1} -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
+ type ping${1} >/dev/null 2>&1 && PING="ping${1}" || PING="ping -${1}"
+ $PING -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
}
wait_for_ip()