mwan3: fix logical/typo bug in mwan3rtmon 8471/head
authorChen Minqiang <ptpt52@gmail.com>
Thu, 21 Mar 2019 20:26:15 +0000 (04:26 +0800)
committerChen Minqiang <ptpt52@gmail.com>
Fri, 22 Mar 2019 10:11:07 +0000 (18:11 +0800)
This bug was introduced since dd206b7d0bc4a7de739b6dbccbac5b5ffcae9024
mwan3_remon_ipv4 and mwan3_remon_ipv6 is command to run not a variable
I add some comments on them hopefully people will notice it

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
net/mwan3/Makefile
net/mwan3/files/lib/mwan3/mwan3.sh
net/mwan3/files/usr/sbin/mwan3rtmon

index 9ff6e7e01c0e0a2b2415a8b0904fd157cb6db218..03fb2be88bc1e37461637de7f6afb719cf0607ea 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwan3
-PKG_VERSION:=2.7.11
+PKG_VERSION:=2.7.12
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
 PKG_LICENSE:=GPLv2
index a3343739b682008b4bea7b81324c776aa88b0cf0..4bb8f34a947a9b14f3446f5c87b805a90f73fcf7 100644 (file)
@@ -32,6 +32,8 @@ MM_BLACKHOLE=""
 MMX_UNREACHABLE=""
 MM_UNREACHABLE=""
 
+# return true(=0) if has any mwan3 interface enabled
+# otherwise return false
 mwan3_rtmon_ipv4()
 {
        local tid=1
@@ -61,6 +63,8 @@ mwan3_rtmon_ipv4()
        return $ret
 }
 
+# return true(=0) if has any mwan3 interface enabled
+# otherwise return false
 mwan3_rtmon_ipv6()
 {
        local tid=1
index f68c298cd0b95e128fea02de0797ef8ed26432f1..9165de554f68a91ae16a586d69617ca225215420 100755 (executable)
@@ -25,14 +25,14 @@ main() {
        sleep 3
        while true; do
                mwan3_lock "service" "mwan3rtmon"
-               [ mwan3_remon_ipv4 = "1" ] || \
-               [ mwan3_rtmon_ipv6 = "1" ] && break
+               mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6
+               ret=$?
                mwan3_unlock "service" "mwan3rtmon"
+               [ "$ret" = "0" ] || break
                [ "$rtmon_interval" = "0" ] && break
                sleep "$rtmon_interval" &
                wait
        done
-       mwan3_unlock "service" "mwan3rtmon"
 }
 
 main "$@"