summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-01-12 08:48:30 +0000
committerstilez <stilez@users.noreply.github.com>2016-01-12 08:48:30 +0000
commit5baae73d21372ce9fff0128e68d362e6858b0707 (patch)
tree2e158fff3c0a29a450a7cb3270e8ef5528b865b6 /src
parentf4c114d4a6fcfcd7e69e6a009db683d78d83189d (diff)
downloadpfsense-5baae73d21372ce9fff0128e68d362e6858b0707.zip
pfsense-5baae73d21372ce9fff0128e68d362e6858b0707.tar.gz
redmine 5702 - switch to high level IPv4 functions instead of low level ip2long32() etc
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/vpn_l2tp.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/usr/local/www/vpn_l2tp.php b/src/usr/local/www/vpn_l2tp.php
index 588ada8..4431a9a 100644
--- a/src/usr/local/www/vpn_l2tp.php
+++ b/src/usr/local/www/vpn_l2tp.php
@@ -135,11 +135,7 @@ if ($_POST) {
if (!$input_errors) {
$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
- $subnet_start = ip2ulong($_POST['remoteip']);
- $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
-
- if ((ip2ulong($_POST['localip']) >= $subnet_start) &&
- (ip2ulong($_POST['localip']) <= $subnet_end)) {
+ if (is_inrange_v4($_POST['localip'], $_POST['remoteip'], ip_after($_POST['remoteip'], $_POST['n_l2tp_units'] - 1)) {
$input_errors[] = gettext("The specified server address lies in the remote subnet.");
}
if ($_POST['localip'] == get_interface_ip("lan")) {
OpenPOWER on IntegriCloud