diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 1f07ac71ff..5b2ac218f7 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -981,11 +981,11 @@ pptpd: EOD; - for ($i = 0; $i < $g['n_pptp_units']; $i++) { + for ($i = 0; $i < $pptpdcfg['n_pptp_units']; $i++) { $mpdconf .= " load pt{$i}\n"; } - for ($i = 0; $i < $g['n_pptp_units']; $i++) { + for ($i = 0; $i < $pptpdcfg['n_pptp_units']; $i++) { $clientip = long2ip(ip2long($pptpdcfg['remoteip']) + $i); $ngif = "ng" . ($i+1); diff --git a/usr/local/www/vpn_pptp.php b/usr/local/www/vpn_pptp.php index 4e0503b875..60abec1342 100755 --- a/usr/local/www/vpn_pptp.php +++ b/usr/local/www/vpn_pptp.php @@ -102,7 +102,7 @@ if ($_POST) { if (!$input_errors) { $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $g['pptp_subnet']); $subnet_start = ip2long($_POST['remoteip']); - $subnet_end = ip2long($_POST['remoteip']) + $g['n_pptp_units'] - 1; + $subnet_end = ip2long($_POST['remoteip']) + $_POST['n_pptp_units'] - 1; if ((ip2long($_POST['localip']) >= $subnet_start) && (ip2long($_POST['localip']) <= $subnet_end)) { @@ -327,6 +327,23 @@ function enable_change(enable_over) { > Enable PPTP server +