]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
t_client.sh: do not require fping6
authorFrank Lichtenheld <frank@lichtenheld.com>
Mon, 22 Aug 2022 14:18:06 +0000 (16:18 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 25 Aug 2022 20:26:19 +0000 (22:26 +0200)
fping and fping6 were merged in version 4.0,
released in 2017. Many recent distributions do
not include the compatibility symlink anymore.

So if we find fping but not fping6 do not error
out but assume that fping is capable of IPv6.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20220822141806.39406-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25058.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tests/t_client.sh.in

index 465c3a33d20dd862abae24036844946fb83ffe99..76ac9b2277e13f08fc57e042ea1cda021f32ad4e 100755 (executable)
@@ -9,7 +9,7 @@
 # - writable current directory to create subdir for logs
 # - t_client.rc in current directory OR source dir that specifies tests
 # - for "ping4" checks: fping binary in $PATH
-# - for "ping6" checks: fping6 binary in $PATH
+# - for "ping6" checks: fping (4.0+) or fping6 binary in $PATH
 #
 
 # by changing this to 1 we can force automated builds to fail
@@ -29,6 +29,8 @@ else
 fi
 
 # Check for external dependencies
+FPING="fping"
+FPING6="fping6"
 which fping > /dev/null
 if [ $? -ne 0 ]; then
     echo "$0: fping is not available in \$PATH" >&2
@@ -36,8 +38,9 @@ if [ $? -ne 0 ]; then
 fi
 which fping6 > /dev/null
 if [ $? -ne 0 ]; then
-    echo "$0: fping6 is not available in \$PATH" >&2
-    exit "${TCLIENT_SKIP_RC}"
+    echo "$0: fping6 is not available in \$PATH, assuming fping 4.0 or later" >&2
+    FPING="fping -4"
+    FPING6="fping -6"
 fi
 
 KILL_EXEC=`which kill`
@@ -220,8 +223,8 @@ run_ping_tests()
     if [ -z "$targetlist" ] ; then return ; fi
 
     case $proto in
-       4) cmd=fping ;;
-       6) cmd=fping6 ;;
+       4) cmd="$FPING" ;;
+       6) cmd="$FPING6" ;;
        *) echo "internal error in run_ping_tests arg 1: '$proto'" >&2
           exit 1 ;;
     esac