diff options
author | bcyrill <cyrill@bannwart.info> | 2013-02-02 20:22:15 +0100 |
---|---|---|
committer | bcyrill <cyrill@bannwart.info> | 2013-02-02 20:22:15 +0100 |
commit | f504b290ff2c8dcf0ba363fb3a7f3aaaa435d28c (patch) | |
tree | 81489a3bfad9c02667ad6670b98847ba28c6e89f /usr/local/www/services_captiveportal_ip.php | |
parent | 49b12e444ede8b9da4e85cb594df15793433e7f0 (diff) | |
download | pfsense-f504b290ff2c8dcf0ba363fb3a7f3aaaa435d28c.zip pfsense-f504b290ff2c8dcf0ba363fb3a7f3aaaa435d28c.tar.gz |
Fix problems with overlapping 'allowed IP subnets' in CP
Diffstat (limited to 'usr/local/www/services_captiveportal_ip.php')
-rwxr-xr-x | usr/local/www/services_captiveportal_ip.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index e0e39d8..410064d 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -67,15 +67,12 @@ if ($_GET['act'] == "del") { $ipent = $a_allowedips[$_GET['id']]; if (isset($config['captiveportal'][$cpzone]['enable'])) { - if (!empty($ipent['sn'])) { - $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip'], $ipent['sn']); - pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 3, $ipent['ip'], $ipent['sn']); - pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 4, $ipent['ip'], $ipent['sn']); - } else { - $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip']); - pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 3, $ipent['ip']); - pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 4, $ipent['ip']); - } + $mask = (!empty($ipent['sn'])) ? $ipent['sn'] : 32; + + $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip'], $mask); + pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 3, $ipent['ip'], $mask); + pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_DEL, 4, $ipent['ip'], $mask); + if (is_array($ipfw)) { captiveportal_free_dn_ruleno($ipfw['dnpipe']); pfSense_pipe_action("pipe delete {$ipfw['dnpipe']}"); |