summaryrefslogtreecommitdiff
path: root/package/firewall/files/uci_firewall.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-01-19 23:02:11 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-01-19 23:02:11 +0000
commit6eae630652590195591785a848fd239714a0dfe5 (patch)
tree4615095e7abd079819dc970cd76713aef00c9c78 /package/firewall/files/uci_firewall.sh
parentc8e7192064680ec3c44c6161312e93be6e871c83 (diff)
downloadmtk-20170518-6eae630652590195591785a848fd239714a0dfe5.zip
mtk-20170518-6eae630652590195591785a848fd239714a0dfe5.tar.gz
mtk-20170518-6eae630652590195591785a848fd239714a0dfe5.tar.bz2
firewall: fix a race condition preventing interfaces from being added to the firewall on boot
SVN-Revision: 19232
Diffstat (limited to 'package/firewall/files/uci_firewall.sh')
-rwxr-xr-xpackage/firewall/files/uci_firewall.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh
index 05fe39b..49e5ca8 100755
--- a/package/firewall/files/uci_firewall.sh
+++ b/package/firewall/files/uci_firewall.sh
@@ -506,9 +506,13 @@ fw_init() {
uci_set_state firewall core loaded 1
config_set core loaded 1
config_foreach fw_check_notrack zone
- INTERFACES="$(sh -c '. /etc/functions.sh; config_load network; config_foreach echo interface')"
+ INTERFACES="$(sh -c '
+ . /etc/functions.sh; config_load network
+ echo_up() { local up; config_get_bool up "$1" up 0; [ $up = 1 ] && echo "$1"; }
+ config_foreach echo_up interface
+ ')"
for interface in $INTERFACES; do
- fw_addif "$interface"
+ fw_event ifup "$interface"
done
}