From d167e3718d147a1b4036c5e7c423c932705935e3 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 15 Jan 2019 10:22:21 +0100 Subject: [PATCH] mwan3: lock critical section on mwan3 down Signed-off-by: Florian Eckert --- net/mwan3/files/usr/sbin/mwan3 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mwan3/files/usr/sbin/mwan3 b/net/mwan3/files/usr/sbin/mwan3 index 6aee3db0c..fa8f0a4d5 100755 --- a/net/mwan3/files/usr/sbin/mwan3 +++ b/net/mwan3/files/usr/sbin/mwan3 @@ -136,6 +136,8 @@ stop() { local ipset route rule table IP IPT pid + mwan3_lock + for pid in $(pgrep -f "mwan3rtmon"); do kill -TERM "$pid" > /dev/null 2>&1 sleep 1 @@ -184,6 +186,8 @@ stop() $IPS -q destroy $ipset done + mwan3_unlock + mwan3_lock_clean rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR