mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
mwan3: fix race condition in route loading
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
committed by
Florian Eckert
parent
5691ff247f
commit
21ac1b2c3e
@@ -158,6 +158,7 @@ main()
|
|||||||
sh -c "echo \$\$; exec $IP monitor route" | {
|
sh -c "echo \$\$; exec $IP monitor route" | {
|
||||||
read -r monitor_pid
|
read -r monitor_pid
|
||||||
trap_with_arg func_trap "$monitor_pid" SIGINT SIGTERM SIGKILL
|
trap_with_arg func_trap "$monitor_pid" SIGINT SIGTERM SIGKILL
|
||||||
|
KILL -SIGSTOP $$
|
||||||
while IFS='' read -r line; do
|
while IFS='' read -r line; do
|
||||||
[ -z "${line##*table*}" ] && continue
|
[ -z "${line##*table*}" ] && continue
|
||||||
LOG debug "handling route update $family '$line'"
|
LOG debug "handling route update $family '$line'"
|
||||||
@@ -165,11 +166,10 @@ main()
|
|||||||
done
|
done
|
||||||
} &
|
} &
|
||||||
child=$!
|
child=$!
|
||||||
kill -SIGSTOP $child
|
|
||||||
trap_with_arg func_trap "$child" SIGINT SIGTERM SIGKILL
|
trap_with_arg func_trap "$child" SIGINT SIGTERM SIGKILL
|
||||||
mwan3_set_connected_${family}
|
mwan3_set_connected_${family}
|
||||||
mwan3_add_all_routes ${family}
|
mwan3_add_all_routes ${family}
|
||||||
kill -SIGCONT $child
|
kill -SIGCONT $child
|
||||||
wait $!
|
wait $child
|
||||||
}
|
}
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user