diff options
author | Renato Botelho <renato@netgate.com> | 2016-02-24 08:50:02 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-02-24 11:01:49 -0300 |
commit | 49aab2599ca7dcc961224aa581d2669bd870f268 (patch) | |
tree | 09c4ca57493837bd8a994a0db11731760690cffb | |
parent | b90d635e1c8838a515ec4d751a8ecc9f1e4d5caf (diff) | |
download | pfsense-49aab2599ca7dcc961224aa581d2669bd870f268.zip pfsense-49aab2599ca7dcc961224aa581d2669bd870f268.tar.gz |
Use high level functions
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 5d88ebd..31a36eb 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -438,8 +438,12 @@ if (isset($_POST['submit'])) { } if (is_numeric($pool) || ($act == "newpool")) { - if (!((ip2ulong($_POST['range_from']) > ip2ulong($config['dhcpd'][$if]['range']['to'])) || - (ip2ulong($_POST['range_to']) < ip2ulong($config['dhcpd'][$if]['range']['from'])))) { + if (is_inrange_v4($_POST['range_from'], + $config['dhcpd'][$if]['range']['from'], + $config['dhcpd'][$if]['range']['to']) || + is_inrange_v4($_POST['range_to'], + $config['dhcpd'][$if]['range']['from'], + $config['dhcpd'][$if]['range']['to'])) { $input_errors[] = gettext("The specified range must not be within the DHCP range for this interface."); } } @@ -449,8 +453,10 @@ if (isset($_POST['submit'])) { continue; } - if (!((ip2ulong($_POST['range_from']) > ip2ulong($p['range']['to'])) || - (ip2ulong($_POST['range_to']) < ip2ulong($p['range']['from'])))) { + if (is_inrange_v4($_POST['range_from'], + $p['range']['from'], $p['range']['to']) || + is_inrange_v4($_POST['range_to'], + $p['range']['from'], $p['range']['to'])) { $input_errors[] = gettext("The specified range must not be within the range configured on a DHCP pool for this interface."); break; } |