summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2013-01-27 07:35:09 -0800
committerErmal Luçi <eri@pfsense.org>2013-01-27 07:35:09 -0800
commit8d1f1034c2333b0536ae8cfee57c9d3fd838aeb0 (patch)
treec647258370d16223093120741328c45213adc535
parent965ce4c68062a22fcc4e5e9da7fa15a90af9c832 (diff)
parent1f8c88190a610bc4fb732019e1b0dcdc2d7dd121 (diff)
downloadpfsense-8d1f1034c2333b0536ae8cfee57c9d3fd838aeb0.zip
pfsense-8d1f1034c2333b0536ae8cfee57c9d3fd838aeb0.tar.gz
Merge pull request #350 from bcyrill/cp_allowedip
Fix ipfw config generation for allowed IPs
-rw-r--r--etc/inc/captiveportal.inc4
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php20
2 files changed, 12 insertions, 12 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 968878c..71dd03e 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -987,9 +987,9 @@ function captiveportal_allowedip_configure_entry($ipent, $ishostname = false) {
$enBwdown = empty($ipent['bw_down']) ? 0 : intval($ipent['bw_down']);
$pipeno = captiveportal_get_next_dn_ruleno();
- $rules .= "pipe {$pipeno} config bw {$ipent['bw_up']}Kbit/s queue 100 buckets 16\n";
+ $rules .= "pipe {$pipeno} config bw {$enBwup}Kbit/s queue 100 buckets 16\n";
$pipedown = $pipeno + 1;
- $rules .= "pipe {$pipedown} config bw {$ipent['bw_down']}Kbit/s queue 100 buckets 16\n";
+ $rules .= "pipe {$pipedown} config bw {$enBwdown}Kbit/s queue 100 buckets 16\n";
if ($ishostname === true) {
$cp_filterdns_conf .= "ipfw {$ipent['hostname']} 3 pipe {$pipeno}\n";
$cp_filterdns_conf .= "ipfw {$ipent['hostname']} 4 pipe {$pipedown}\n";
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index fa2f1ff..8c8c79e 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -145,18 +145,18 @@ if ($_POST) {
write_config();
if (isset($a_cp[$cpzone]['enable']) && is_module_loaded("ipfw.ko")) {
- if (is_ipaddr($oldip)) {
- if (!empty($oldmask))
- $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip, $oldmask);
- else
- $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip);
- }
- $rules = "table 3 delete {$oldip}";
- $rules .= "table 4 delete {$oldip}";
+ if (is_ipaddr($oldip)) {
+ if (!empty($oldmask))
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip, $oldmask);
+ else
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip);
+ }
+ $rules = "table 3 delete {$oldip}\n";
+ $rules .= "table 4 delete {$oldip}\n";
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
- $rules .= "pipe delete {$ipfw['dnpipe']}";
- $rules .= "pipe delete " . ($ipfw['dnpipe']+1);
+ $rules .= "pipe delete {$ipfw['dnpipe']}\n";
+ $rules .= "pipe delete " . ($ipfw['dnpipe']+1 . "\n");
}
$rules .= captiveportal_allowedip_configure_entry($ip);
$uniqid = uniqid("{$cpzone}_allowed");
OpenPOWER on IntegriCloud