From 1fe50da4bb3a207aff8f8d792d39a11f854edf13 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 14 Sep 2010 23:11:12 +0000 Subject: firewall: deliver remove hotplug events for all active zones/networks when restarting the firewall SVN-Revision: 23062 --- package/firewall/files/lib/core.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'package/firewall/files/lib/core.sh') diff --git a/package/firewall/files/lib/core.sh b/package/firewall/files/lib/core.sh index 03a80c6f6c..2178e0505c 100644 --- a/package/firewall/files/lib/core.sh +++ b/package/firewall/files/lib/core.sh @@ -49,6 +49,7 @@ fw_start() { fw_callback post core + uci_set_state firewall core zones "$FW_ZONES" uci_set_state firewall core loaded 1 } @@ -57,6 +58,19 @@ fw_stop() { fw_callback pre stop + local old_zones z + config_get old_zones core zones + for z in $old_zones; do + local old_networks n i + config_get old_networks core "${z}_networks" + for n in $old_networks; do + config_get i core "${n}_ifname" + [ -n "$i" ] && env -i ACTION=remove ZONE="$z" \ + INTERFACE="$n" DEVICE="$i" \ + /sbin/hotplug-call firewall + done + done + fw_clear ACCEPT fw_callback post stop -- cgit v1.2.3