Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Li Zhijian and committed by
Daniel Borkmann
deee2cae 27b31e68

+4 -2
+2 -1
tools/testing/selftests/bpf/test_skb_cgroup_id.sh
··· 10 10 echo -n "Wait for testing link-local IP to become available " 11 11 for _i in $(seq ${MAX_PING_TRIES}); do 12 12 echo -n "." 13 - if ping -6 -q -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then 13 + if $PING6 -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then 14 14 echo " OK" 15 15 return 16 16 fi ··· 58 58 BPF_PROG_SECTION="cgroup_id_logger" 59 59 BPF_PROG_ID=0 60 60 PROG="${DIR}/test_skb_cgroup_id_user" 61 + type ping6 >/dev/null 2>&1 && PING6="ping6" || PING6="ping -6" 61 62 62 63 main
+2 -1
tools/testing/selftests/bpf/test_sock_addr.sh
··· 4 4 5 5 ping_once() 6 6 { 7 - ping -${1} -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1 7 + type ping${1} >/dev/null 2>&1 && PING="ping${1}" || PING="ping -${1}" 8 + $PING -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1 8 9 } 9 10 10 11 wait_for_ip()