From dd206b7d0bc4a7de739b6dbccbac5b5ffcae9024 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 15 Jan 2019 10:20:02 +0100 Subject: [PATCH] mwan3: lock critical mwan3rtmon section Signed-off-by: Florian Eckert --- net/mwan3/files/usr/sbin/mwan3rtmon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mwan3/files/usr/sbin/mwan3rtmon b/net/mwan3/files/usr/sbin/mwan3rtmon index afdc96d1a..f8e6ec081 100755 --- a/net/mwan3/files/usr/sbin/mwan3rtmon +++ b/net/mwan3/files/usr/sbin/mwan3rtmon @@ -23,11 +23,16 @@ main() { config_get rtmon_interval globals rtmon_interval '5' sleep 3 - while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do + while true; do + mwan3_lock + [ mwan3_remon_ipv4 = "1" ] || \ + [ mwan3_rtmon_ipv6 = "1" ] && break + mwan3_unlock [ "$rtmon_interval" = "0" ] && break sleep "$rtmon_interval" & wait done + mwan3_unlock } main "$@"