diff options
author | sullrich <sullrich@pfsense.org> | 2009-12-02 19:59:34 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-12-02 19:59:34 -0500 |
commit | 2c75b451becbf3e74466df54e2b3bdbe02ac7abf (patch) | |
tree | 921dd839d06037ffe0e0c2b2df7b411f9b43c0e1 | |
parent | a2c8cd51dcce4fd4c7139776029605d6a3665c65 (diff) | |
download | pfsense-2c75b451becbf3e74466df54e2b3bdbe02ac7abf.zip pfsense-2c75b451becbf3e74466df54e2b3bdbe02ac7abf.tar.gz |
Disallow virtual IP addresses withing the range Ticket #50
-rwxr-xr-x | usr/local/www/services_dhcp.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 7d45643..6b238af 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -222,15 +222,20 @@ if ($_POST) { $input_errors[] = "A valid IP address must be specified for the TFTP server."; if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) $input_errors[] = "A valid IP address must be specified for the network boot server."; - + if(gen_subnet($ifcfgip, $ifcfgsn) == $_POST['range_from']) $input_errors[] = "You cannot use the network address in the starting subnet range."; if(gen_subnet_max($ifcfgip, $ifcfgsn) == $_POST['range_to']) $input_errors[] = "You cannot use the broadcast address in the ending subnet range."; - //if(is_inrange($ifcfgip, $_POST['range_from'], $_POST['range_to'])) - // $input_errors[] = "Address range includes the interface IP $ifcfgip."; - + // Disallow a range that includes the virtualip + foreach($config['virtualip']['vip'] as $vip) { + if(strtoupper($vip['interface']) == strtoupper($if)) + if($vip['subnet']) + if(is_inrange($vip['subnet'], $_POST['range_from'], $_POST['range_to'])) + $input_errors[] = "The virtual IP address {$vip['subnet']} falls within the subnet range."; + } + if (!$input_errors) { /* make sure the range lies within the current subnet */ $subnet_start = (ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)); |