summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-02-03 23:08:58 +0100
committerSeth Mos <seth.mos@dds.nl>2011-02-03 23:08:58 +0100
commit54ac51b569af3db2a0d4fe29563090265355725e (patch)
treed4a025ee65b467fddc12439265ff408cff633f8e /usr/local/www/system_gateways_edit.php
parentcf6bc278670a76710a364ccc42ab77a2b061ba14 (diff)
downloadpfsense-54ac51b569af3db2a0d4fe29563090265355725e.zip
pfsense-54ac51b569af3db2a0d4fe29563090265355725e.tar.gz
Make the subnet check failure better readable
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 8db8764..66ee192 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -120,14 +120,16 @@ if ($_POST) {
}
if (is_ipaddrv4($parent_ip)) {
$parent_sn = get_interface_subnet($_POST['interface']);
- if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['gateway'])) {
- $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
+ $subnet = gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn;
+ if(!ip_in_subnet($_POST['gateway'], $subnet) && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['gateway'])) {
+ $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet '{$subnet}'."), $_POST['gateway']);
}
}
if (is_ipaddrv6($parent_ip)) {
$parent_sn = get_interface_subnetv6($_POST['interface']);
- if(!ip_in_subnet($_POST['gateway'], gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn)) {
- $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
+ $subnet = gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn;
+ if(!ip_in_subnet($_POST['gateway'], $subnet)) {
+ $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet '{$subnet}'."), $_POST['gateway']);
}
}
}
OpenPOWER on IntegriCloud