diff options
author | jim-p <jimp@pfsense.org> | 2011-07-12 19:57:42 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-07-12 19:57:42 -0400 |
commit | 8b6313a4d3eb1895b6c855436a50606cc7691ad4 (patch) | |
tree | 97784c2235366f00f42961dd4557e82fadf1ce8c /usr/local/www/services_dhcp.php | |
parent | 13b9dba9aae25edf62d6cd58c7446329b0dd913c (diff) | |
parent | fd3e19f3bf9499b944263c0acaeaa6446260f197 (diff) | |
download | pfsense-8b6313a4d3eb1895b6c855436a50606cc7691ad4.zip pfsense-8b6313a4d3eb1895b6c855436a50606cc7691ad4.tar.gz |
Merge remote-tracking branch 'upstream/master'
Conflicts:
etc/inc/easyrule.inc
etc/inc/filter.inc
etc/inc/interfaces.inc
etc/inc/services.inc
etc/inc/xmlrpc_client.inc
usr/local/www/fbegin.inc
usr/local/www/services_dhcp.php
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index ea5af18..122912d 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -216,6 +216,12 @@ if ($_POST) { $input_errors[] = gettext("A valid IP address must be specified for the gateway."); if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); + $parent_ip = get_interface_ip($_POST['if']); + if (is_ipaddrv4($parent_ip) && $_POST['gateway']) { + $parent_sn = get_interface_subnet($_POST['if']); + if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) + $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']); + } if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); |