From 5baae73d21372ce9fff0128e68d362e6858b0707 Mon Sep 17 00:00:00 2001 From: stilez Date: Tue, 12 Jan 2016 08:48:30 +0000 Subject: redmine 5702 - switch to high level IPv4 functions instead of low level ip2long32() etc --- src/usr/local/www/vpn_l2tp.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') 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")) { -- cgit v1.1