[package] firewall: fix a race condition preventing interfaces from being added to...
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 19 Jan 2010 23:02:11 +0000 (23:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 19 Jan 2010 23:02:11 +0000 (23:02 +0000)
SVN-Revision: 19232

package/firewall/Makefile
package/firewall/files/uci_firewall.sh

index 8d0452602b162d879a7c41dc18ba04c891526637..abc6020434a9009fea0cad8178bebacb90be0cda 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=firewall
 
 PKG_VERSION:=1
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 
 include $(INCLUDE_DIR)/package.mk
 
index 05fe39beb0f5b5ad0777d064f817cca248d2b488..49e5ca8595acf52425c8b67f03d5265ca78f7dc0 100755 (executable)
@@ -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
 }