From a004d07632475536ceca09d734c06250647e3541 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Fri, 22 Mar 2019 04:26:15 +0800 Subject: [PATCH] mwan3: fix logical/typo bug in mwan3rtmon 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 --- net/mwan3/Makefile | 2 +- net/mwan3/files/lib/mwan3/mwan3.sh | 4 ++++ net/mwan3/files/usr/sbin/mwan3rtmon | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index 9ff6e7e01..03fb2be88 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -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 PKG_LICENSE:=GPLv2 diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index a3343739b..4bb8f34a9 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -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 diff --git a/net/mwan3/files/usr/sbin/mwan3rtmon b/net/mwan3/files/usr/sbin/mwan3rtmon index f68c298cd..9165de554 100755 --- a/net/mwan3/files/usr/sbin/mwan3rtmon +++ b/net/mwan3/files/usr/sbin/mwan3rtmon @@ -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 "$@"