net/mwan3: mwan3track skip track ips if realibility is accomplished

If enough tracking ip are pinged skip the reset. They are not needed
anymore to mark the interface as up.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2017-08-25 11:42:32 +02:00
parent cabb835ed4
commit ec5542ab2b

View file

@ -92,20 +92,24 @@ main() {
sleep_time=$interval sleep_time=$interval
for track_ip in $track_ips; do for track_ip in $track_ips; do
case "$track_method" in if [ $host_up_count -lt $reliability ]; then
ping) case "$track_method" in
ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;; ping)
arping) ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;;
arping -I $DEVICE -c $count -w $timeout -q $track_ip &> /dev/null ;; arping)
httping) arping -I $DEVICE -c $count -w $timeout -q $track_ip &> /dev/null ;;
httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null ;; httping)
esac httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null ;;
if [ $? -eq 0 ]; then esac
let host_up_count++ if [ $? -eq 0 ]; then
echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip} let host_up_count++
echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
else
let lost++
echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
fi
else else
let lost++ echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}
echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
fi fi
done done