diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-01-29 01:44:16 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-01-29 01:44:40 +0000 |
commit | e227df57506b438e96a193c247dda4222400d09a (patch) | |
tree | b36718f0d893b9b30ed5636cdab46aafaff2cba8 | |
parent | 883c53c92f1b99b3aab1d94f05168969423255b3 (diff) | |
download | pfsense-e227df57506b438e96a193c247dda4222400d09a.zip pfsense-e227df57506b438e96a193c247dda4222400d09a.tar.gz |
Check if the gateway if part of the interface subnet only if we can get the interface ip address.
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 0ec27c3..4885760 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -107,9 +107,11 @@ if ($_POST) { if ($_POST['gateway'] && (is_ipaddr($_POST['gateway'])) && ($pconfig['attribute'] != "system") && !$_REQUEST['isAjax']) { $parent_ip = get_interface_ip($_POST['interface']); - $parent_sn = get_interface_subnet($_POST['interface']); - if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn)) { - $input_errors[] = "The gateway address {$_POST['gateway']} does not lie within the chosen interface's subnet."; + if (is_ipaddr($parent_ip)) { + $parent_sn = get_interface_subnet($_POST['interface']); + if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn)) { + $input_errors[] = "The gateway address {$_POST['gateway']} does not lie within the chosen interface's subnet."; + } } } if (($_POST['monitor'] <> "") && !is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") { |