summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-06-01 20:31:56 +0000
committerErmal <eri@pfsense.org>2010-06-01 20:31:56 +0000
commit4d349edec5f20b7f94d5ed0c97f382b9e082081f (patch)
tree6e94a1f84c8c31b9af14bc56484191baf0b991ab /usr/local/captiveportal
parent3bf8eb9345c930159f60bdadf10f670730a44afa (diff)
downloadpfsense-4d349edec5f20b7f94d5ed0c97f382b9e082081f.zip
pfsense-4d349edec5f20b7f94d5ed0c97f382b9e082081f.tar.gz
Free ipfw ruleno so it can be reused. Propperly delete passthrough mac entries that are not used.
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-xusr/local/captiveportal/index.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index 7d5494e..80bbc3f 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -296,6 +296,14 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
if ($_POST['replacemacpassthru']) {
foreach ($config['captiveportal']['passthrumac'] as $idx => $macent) {
if ($macent['mac'] == $mac['mac']) {
+ $macrules = "";
+ $ruleno = captiveportal_get_ipfw_passthru_ruleno($mac['mac']);
+ if ($ruleno) {
+ captiveportal_free_ipfw_ruleno($ruleno, true);
+ $macrules .= "delete {$ruleno}";
+ ++$ruleno;
+ $macrules .= "delete {$ruleno}";
+ }
unset($config['captiveportal']['passthrumac'][$idx]);
$mac['mac'] = $clientmac;
$config['captiveportal']['passthrumac'][] = $mac;
OpenPOWER on IntegriCloud