diff options
author | Li Zhijian <lizhijian@cn.fujitsu.com> | 2018-10-30 11:15:55 +0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-31 23:05:30 +0100 |
commit | deee2cae27d1914850195e3fb219cc611e953560 (patch) | |
tree | 31d7699e2e0b2b0755499535dac0a325e4e57569 /tools/testing/selftests/bpf/test_sock_addr.sh | |
parent | 27b31e68bc9fc25c519c7772fa23913687218d5f (diff) | |
download | linux-stable-deee2cae27d1914850195e3fb219cc611e953560.tar.gz linux-stable-deee2cae27d1914850195e3fb219cc611e953560.tar.bz2 linux-stable-deee2cae27d1914850195e3fb219cc611e953560.zip |
kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
ping binary on some distros doesn't support "ping -6" anymore.
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_sock_addr.sh')
-rwxr-xr-x | tools/testing/selftests/bpf/test_sock_addr.sh | 3 |
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() |