diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2017-08-17 15:21:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 15:21:34 +0300 |
commit | 4a972286652fe5601beda941d2fa11a05794d914 (patch) | |
tree | e872a53e4d5dde6c5de698d0d2f237d1b1721fd1 | |
parent | 08192ae89eb7fd7005db0746e3f207398e3d7e47 (diff) | |
parent | 284284ef2e70a3b76306287ab0c04d26dd9a30ce (diff) |
Merge pull request #4721 from marcin1j/pr/20170817-mwan3-fix-815e83
/ mwan3: fix bugs introduced in 815e83d4
-rw-r--r-- | net/mwan3/files/etc/hotplug.d/iface/15-mwan3 | 4 | ||||
-rwxr-xr-x | net/mwan3/files/usr/sbin/mwan3track | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 index f9638e62b..83b5f70e0 100644 --- a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 +++ b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 @@ -68,13 +68,13 @@ case "$ACTION" in if [ ${running} -eq 1 -a "${status}" = "online" ]; then mwan3_create_iface_rules $INTERFACE $DEVICE mwan3_create_iface_route $INTERFACE $DEVICE - mwan3_track $INTERFACE $DEVICE ${src_ip} "online" + mwan3_track $INTERFACE $DEVICE "online" "$src_ip" mwan3_set_policies_iptables mwan3_set_user_rules mwan3_flush_conntrack $INTERFACE $DEVICE "ifup" else $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})" - mwan3_track $INTERFACE $DEVICE "offline" + mwan3_track $INTERFACE $DEVICE "offline" "$src_ip" fi ;; ifdown) diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index bdb793b59..91136e8f8 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -52,6 +52,7 @@ main() { INTERFACE=$1 DEVICE=$2 STATUS=$3 + SRC_IP=$4 mkdir -p /var/run/mwan3track/$1 trap clean_up SIGINT SIGTERM trap if_down SIGUSR1 @@ -93,11 +94,11 @@ main() { for track_ip in $track_ips; do case "$track_method" in ping) - ping -I $2 -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;; + ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;; arping) - arping -I $2 -c $count -w $timeout -q $track_ip &> /dev/null ;; + arping -I $DEVICE -c $count -w $timeout -q $track_ip &> /dev/null ;; httping) - httping -y $3 -c $count -t $timeout -q $track_ip &> /dev/null ;; + httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null ;; esac if [ $? -eq 0 ]; then let host_up_count++ |