firewall: fix a possible deadlock when the firewall config has syntax errors during restart

SVN-Revision: 21501
lede-17.01
Jo-Philipp Wich 2010-05-18 20:15:47 +00:00
parent 6b3bfbf943
commit 91519d51e9
1 changed files with 4 additions and 2 deletions

View File

@ -8,14 +8,15 @@ include /lib/network
fw_start() { fw_start() {
fw_init fw_init
lock /var/lock/firewall.start
FW_DEFAULTS_APPLIED= FW_DEFAULTS_APPLIED=
fw_is_loaded && { fw_is_loaded && {
echo "firewall already loaded" >&2 echo "firewall already loaded" >&2
exit 1 exit 1
} }
lock /var/lock/firewall.start
uci_set_state firewall core "" firewall_state uci_set_state firewall core "" firewall_state
fw_clear DROP fw_clear DROP
@ -93,6 +94,7 @@ fw_die() {
echo "Error:" "$@" >&2 echo "Error:" "$@" >&2
fw_log error "$@" fw_log error "$@"
fw_stop fw_stop
lock -u /var/lock/firewall.start
exit 1 exit 1
} }