Merge pull request #5 from aidanharris/master

Make sure ping uses ipv4 when $TESTPROTO equals -4 (OpenWrt ping may use v4 or v6, depending on the DNS resolution, so force it to use `ping4`). But macOS doesn't implement `ping4`, requiring the special case
This commit is contained in:
Rich Brown 2020-11-17 07:36:33 -05:00 committed by GitHub
commit 44d1102cde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 6 deletions

View file

@ -114,9 +114,9 @@ start_pings() {
# Start Ping
if [ $TESTPROTO -eq "-4" ]
then
ping $PINGHOST > $PINGFILE &
"${PING4}" $PINGHOST > $PINGFILE &
else
ping6 $PINGHOST > $PINGFILE &
"${PING6}" $PINGHOST > $PINGFILE &
fi
ping_pid=$!
# echo "Ping PID: $ping_pid"
@ -186,6 +186,11 @@ measure_direction() {
# set an initial values for defaults
TESTHOST="netperf.bufferbloat.net"
TESTDUR="60"
PING4=ping
command -v ping4 > /dev/null 2>&1 && PING4=ping4
PING6=ping6
PINGHOST="gstatic.com"
MAXSESSIONS="5"
TESTPROTO="-4"

View file

@ -108,9 +108,9 @@ start_pings() {
# Start Ping
if [ $TESTPROTO -eq "-4" ]
then
ping $PINGHOST > $PINGFILE &
"${PING4}" $PINGHOST > $PINGFILE &
else
ping6 $PINGHOST > $PINGFILE &
"${PING6}" $PINGHOST > $PINGFILE &
fi
ping_pid=$!
# echo "Ping PID: $ping_pid"
@ -127,6 +127,11 @@ start_pings() {
# set an initial values for defaults
TESTDUR="60"
PING4=ping
command -v ping4 > /dev/null 2>&1 && PING4=ping4
PING6=ping6
PINGHOST="gstatic.com"
TESTPROTO="-4"

View file

@ -72,6 +72,11 @@ summarize_pings() {
# set an initial values for defaults
TESTHOST="netperf.bufferbloat.net"
TESTDUR="60"
PING4=ping
command -v ping4 > /dev/null 2>&1 && PING4=ping4
PING6=ping6
PINGHOST="gstatic.com"
MAXSESSIONS=4
TESTPROTO=-4
@ -132,9 +137,9 @@ echo "$DATE Testing $TESTHOST ($PROTO) with $MAXSESSIONS streams down and up whi
# Start Ping
if [ $TESTPROTO -eq "-4" ]
then
ping $PINGHOST > $PINGFILE &
"${PING4}" $PINGHOST > $PINGFILE &
else
ping6 $PINGHOST > $PINGFILE &
"${PING6}" $PINGHOST > $PINGFILE &
fi
ping_pid=$!
# echo "Ping PID: $ping_pid"