summaryrefslogtreecommitdiffstats
path: root/etc/inc/captiveportal.inc
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:21:05 +0100
commitfd9e6066143b3d7e21be07d901cd5378acad5131 (patch)
tree33d82223cb60c468b0c0461d7602b8c66e0df0af /etc/inc/captiveportal.inc
parent18f4d6c90d01d5ca0d8f3795d67c278a95349faa (diff)
downloadpfsense-fd9e6066143b3d7e21be07d901cd5378acad5131.zip
pfsense-fd9e6066143b3d7e21be07d901cd5378acad5131.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/inc/captiveportal.inc')
-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