Browse Source

mwan3: Don't use /128 address for ping source

An interface can have both a /64 and a /128 from a provider.

In such a case, use the address from the /64 to do the ping check, not
the /128.

Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
lilik-openwrt-22.03
Brian J. Murrell 5 years ago
committed by Florian Eckert
parent
commit
49cf5eac5c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      net/mwan3/files/usr/sbin/mwan3track

+ 1
- 1
net/mwan3/files/usr/sbin/mwan3track View File

@ -136,7 +136,7 @@ main() {
# https://bugs.openwrt.org/index.php?do=details&task_id=2897 # https://bugs.openwrt.org/index.php?do=details&task_id=2897
# so get the IP address of the interface and use that instead # 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 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne '/\/128/d' -e 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
fi fi
if [ $check_quality -eq 0 ]; then if [ $check_quality -eq 0 ]; then
ping -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null ping -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null


Loading…
Cancel
Save