summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-06-22 14:50:55 -0400
committerjim-p <jimp@pfsense.org>2011-06-22 14:52:05 -0400
commitff629977e3d45c1d41fc12449e647abd8b780241 (patch)
tree69d002802a945953d8d53b8e0e18529d5971fac9 /etc
parent91c31339104f424dad3de75f815697994b68a7c3 (diff)
downloadpfsense-ff629977e3d45c1d41fc12449e647abd8b780241.zip
pfsense-ff629977e3d45c1d41fc12449e647abd8b780241.tar.gz
Properly generate a subnet based on the range of IPs for PPTP clients. Bonus: fix off-by-one math error in the NAT code that does the same thing. Fixes #1614
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 38ab773..b62f7ce 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1349,7 +1349,7 @@ function filter_nat_rules_generate() {
}
/* PPTP subnet */
if(($config['pptpd']['mode'] == "server" ) && is_private_ip($config['pptpd']['remoteip'])) {
- $pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+$config['pptpd']['n_pptp_units']));
+ $pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+($config['pptpd']['n_pptp_units']-1)));
$numberofnathosts += count($pptp_subnets);
$tonathosts .= implode(" ", $pptp_subnets) . " ";
}
@@ -1622,7 +1622,7 @@ function filter_generate_user_rule_arr($rule) {
}
function filter_generate_address(& $rule, $target = "source", $isnat = false) {
- global $FilterIflist;
+ global $FilterIflist, $config;
$src = "";
if(isset($rule[$target]['any'])) {
@@ -1664,9 +1664,8 @@ function filter_generate_address(& $rule, $target = "source", $isnat = false) {
$src = "{$lansa}/{$lansn}";
break;
case 'pptp':
- $pptpsa = gen_subnet($FilterIflist['pptp']['sa'], $FilterIflist['pptp']['sn']);
- $pptpsn = $FilterIflist['pptp']['sn'];
- $src = "{$pptpsa}/{$pptpsn}";
+ $pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+($config['pptpd']['n_pptp_units']-1)));
+ $src = "{ " . implode(" ", $pptp_subnets) . " }";
break;
case 'pppoe':
/* XXX: This needs to be fixed somehow! */
OpenPOWER on IntegriCloud