mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
net/mwan3: add lock for mwan3 hotplug script
If more then one interface get up/down at once mwan3 could be in a
undefined state, because more then one mwan3 hotplug script are running
and editing the iptables.
Lock the critical section should solve this issue.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit b6e9debc1b)
This commit is contained in:
@@ -35,6 +35,7 @@ if [ "$ACTION" == "ifup" ]; then
|
|||||||
[ -n "$gateway" ] || exit 9
|
[ -n "$gateway" ] || exit 9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mwan3_lock
|
||||||
$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
|
$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
@@ -58,4 +59,6 @@ case "$ACTION" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
mwan3_unlock
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -7,6 +7,14 @@ IPT4="/usr/sbin/iptables -t mangle -w"
|
|||||||
IPT6="/usr/sbin/ip6tables -t mangle -w"
|
IPT6="/usr/sbin/ip6tables -t mangle -w"
|
||||||
LOG="/usr/bin/logger -t mwan3 -p"
|
LOG="/usr/bin/logger -t mwan3 -p"
|
||||||
|
|
||||||
|
mwan3_lock() {
|
||||||
|
lock /var/run/mwan3.lock
|
||||||
|
}
|
||||||
|
|
||||||
|
mwan3_unlock() {
|
||||||
|
lock -u /var/run/mwan3.lock
|
||||||
|
}
|
||||||
|
|
||||||
mwan3_get_iface_id()
|
mwan3_get_iface_id()
|
||||||
{
|
{
|
||||||
local _tmp _iface _iface_count
|
local _tmp _iface _iface_count
|
||||||
|
|||||||
Reference in New Issue
Block a user