kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
[sfrench/cifs-2.6.git] / tools / testing / selftests / bpf / test_skb_cgroup_id.sh
index 42544a969abc63b734267e696c78d2b338be0ca7..a9bc6f82abc163d47876d4af1f2dcbe540a6c814 100755 (executable)
@@ -10,7 +10,7 @@ wait_for_ip()
        echo -n "Wait for testing link-local IP to become available "
        for _i in $(seq ${MAX_PING_TRIES}); do
                echo -n "."
-               if ping -6 -q -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
+               if $PING6 -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
                        echo " OK"
                        return
                fi
@@ -58,5 +58,6 @@ BPF_PROG_OBJ="${DIR}/test_skb_cgroup_id_kern.o"
 BPF_PROG_SECTION="cgroup_id_logger"
 BPF_PROG_ID=0
 PROG="${DIR}/test_skb_cgroup_id_user"
+type ping6 >/dev/null 2>&1 && PING6="ping6" || PING6="ping -6"
 
 main