From 198ea77bdd7adf8f16443a367a4e3725319a991c Mon Sep 17 00:00:00 2001 From: stilez Date: Tue, 12 Jan 2016 08:39:42 +0000 Subject: redmine 5702 - switch to high level IPv4 functions instead of low level ip2long32() etc --- src/usr/local/www/services_pppoe_edit.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/services_pppoe_edit.php b/src/usr/local/www/services_pppoe_edit.php index e34fcb0..6fe3579 100644 --- a/src/usr/local/www/services_pppoe_edit.php +++ b/src/usr/local/www/services_pppoe_edit.php @@ -167,10 +167,7 @@ if ($_POST) { } $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pppoe_subnet']); - $subnet_start = ip2ulong($_POST['remoteip']); - $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['pppoe_subnet'] - 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['pppoe_subnet'] - 1))) { $input_errors[] = gettext("The specified server address lies in the remote subnet."); } if ($_POST['localip'] == get_interface_ip($_POST['interface'])) { -- cgit v1.1