summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-01-12 12:20:57 +0100
committerErmal LUÇI <eri@pfsense.org>2015-01-12 12:20:57 +0100
commit0fc3c465cde62aa72c92da1add5b7c38281764db (patch)
tree540edfc04f0beab5b9abcfa162ee3fbc505d0532 /etc
parent339e2fe5e66e07a953c28b59e964a96f77edcecd (diff)
downloadpfsense-0fc3c465cde62aa72c92da1add5b7c38281764db.zip
pfsense-0fc3c465cde62aa72c92da1add5b7c38281764db.tar.gz
Actually improve the previous resource leak commit since the function is there but it was not being used during init_rules process.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc22
1 files changed, 1 insertions, 21 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index c42eb35..e24982e 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -484,7 +484,7 @@ function captiveportal_init_rules($reinit = false) {
captiveportal_load_modules();
mwexec("/sbin/ipfw zone {$cpzoneid} create", true);
- captiveportal_flush_dn_ruleno($cpzone);
+ captiveportal_free_dnrules();
$cpips = array();
$ifaces = get_configured_interface_list();
@@ -1491,26 +1491,6 @@ function captiveportal_free_dn_ruleno($ruleno) {
unlock($cpruleslck);
}
-/*
- * To avoid allocating more ids than needed to a zone need
- * to flush them before loading/creating new ruleset
- */
-function captiveportal_flush_dn_ruleno($cpzone) {
- global $config, $g;
-
- $cpruleslck = lock("captiveportalrulesdn", LOCK_EX);
- if (file_exists("{$g['vardb_path']}/captiveportaldn.rules")) {
- $rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportaldn.rules"));
- foreach ($rules as $idx => $zone) {
- if ($zone == $cpzone)
- $rules[$idx] = false;
- }
- file_put_contents("{$g['vardb_path']}/captiveportaldn.rules", serialize($rules));
- unset($rules);
- }
- unlock($cpruleslck);
-}
-
function captiveportal_get_dn_passthru_ruleno($value) {
global $config, $g, $cpzone, $cpzoneid;
OpenPOWER on IntegriCloud