From 18a79362e9838f83ff3e01871750598d92b095bb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 17 May 2010 17:20:37 +0000 Subject: [PATCH] firewall: properly clear hooks in fw_stop() to prevent extensions from being called twice after fw_restart() SVN-Revision: 21488 --- package/firewall/files/lib/core.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package/firewall/files/lib/core.sh b/package/firewall/files/lib/core.sh index bf44231fb0..f37b1e6961 100644 --- a/package/firewall/files/lib/core.sh +++ b/package/firewall/files/lib/core.sh @@ -66,6 +66,11 @@ fw_stop() { uci_revert_state firewall config_clear + + local h + for h in $FW_HOOKS; do unset $h; done + + unset FW_HOOKS unset FW_INITIALIZED } @@ -126,8 +131,10 @@ fw_init() { . $file for hk in $hooks; do for pp in pre post; do - type ${lib}_${pp}_${hk}_cb >/dev/null && + type ${lib}_${pp}_${hk}_cb >/dev/null && { append FW_CB_${pp}_${hk} ${lib} + append FW_HOOKS FW_CB_${pp}_${hk} + } done done done