From 24e5d98bda6734115da53b0bb2eda0a0b74b89ed Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 10 Jul 2011 12:11:32 -0400 Subject: [PATCH] MFC: Do not check to see if gateway alls within a null value. --- usr/local/www/services_dhcp.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index fdd70a90d6..17fbb8085f 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -217,11 +217,10 @@ if ($_POST) { if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_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_ipaddr($parent_ip)) { + if (is_ipaddr($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'])) { + 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_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");