mwan3: use ping -I for ipv6 after tunnel kernel fix

Now that tunnels have been fixed with openwrt commit
c9c7b4b3945c01c2aadf3ef5d9a77c8200db80f1 for stable branch 19.07
ping with src ip is no longer needed.

fixes #13655

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* Update commit message
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
Aaron Goodman 2020-12-21 21:12:23 -05:00 committed by Florian Eckert
parent 2a7bbad223
commit 6bd3f5c377
2 changed files with 4 additions and 9 deletions

View file

@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3 PKG_NAME:=mwan3
PKG_VERSION:=2.8.14 PKG_VERSION:=2.8.15
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de> PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -136,19 +136,14 @@ main() {
if [ $host_up_count -lt $reliability ]; then if [ $host_up_count -lt $reliability ]; then
case "$track_method" in case "$track_method" in
ping) ping)
# pinging IPv6 hosts with an interface is troublesome
# https://bugs.openwrt.org/index.php?do=details&task_id=2897
# so get the IP address of the interface and use that instead
if echo $track_ip | grep -q ':'; then if echo $track_ip | grep -q ':'; then
ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne '/\/128/d' -e '1,/ *inet6 /s/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
[ -z "$ADDR" ] && ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
ping_protocol=6 ping_protocol=6
fi fi
if [ $check_quality -eq 0 ]; then if [ $check_quality -eq 0 ]; then
$PING -$ping_protocol -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null $PING -$ping_protocol -I $DEVICE -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null
result=$? result=$?
else else
ping_result_raw="$($PING -$ping_protocol -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null)" ping_result_raw="$($PING -$ping_protocol -I $DEVICE -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null)"
ping_status=$? ping_status=$?
ping_result=$(echo "$ping_result_raw" | tail -n2) ping_result=$(echo "$ping_result_raw" | tail -n2)
loss="$(echo "$ping_result" | grep "packet loss" | cut -d "," -f3 | awk '{print $1}' | sed -e 's/%//')" loss="$(echo "$ping_result" | grep "packet loss" | cut -d "," -f3 | awk '{print $1}' | sed -e 's/%//')"