summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-08-14 08:05:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-08-14 08:05:54 -0300
commit90bc28cc9d75c59efc06a3aa319239bf7aafa259 (patch)
tree2c1f7f4794ea665edaf089583fa951402cba7b58
parent4262641880e1c0ee9c9e1c1334470c39537173f9 (diff)
downloadpfsense-90bc28cc9d75c59efc06a3aa319239bf7aafa259.zip
pfsense-90bc28cc9d75c59efc06a3aa319239bf7aafa259.tar.gz
Fix checkes for nested aliases containing FQDNs on static routes. It fixes #2941
-rwxr-xr-xusr/local/www/system_routes_edit.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index d87bc0c..631fab0 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -128,23 +128,18 @@ if ($_POST) {
} elseif (is_alias($_POST['network'])) {
$osn = $_POST['network'];
$fqdn_found = 0;
- foreach (preg_split('/\s+/', $aliastable[$osn]) as $tgt) {
- if (!is_ipaddr($tgt)) {
- if ($fqdn_found === 0) {
- $input_errors[] = sprintf(gettext("The alias (%s) has one or more FQDNs configured and cannot be used to configure a static route."), $_POST['network']);
- $fqdn_found = 1;
- }
- continue;
- }
+ foreach (filter_expand_alias_array($osn, true) as $tgt) {
if (is_ipaddrv4($tgt))
$tgt .= "/32";
if (is_ipaddrv6($tgt))
$tgt .= "/128";
- if (!is_subnet($tgt))
- continue;
- if (!is_subnetv6($tgt))
- continue;
- $new_targets[] = $tgt;
+ if (is_fqdn($tgt)) {
+ $input_errors[] = sprintf(gettext("The alias (%s) has one or more FQDNs configured and cannot be used to configure a static route."), $_POST['network']);
+ $fqdn_found = 1;
+ break;
+ }
+ if (is_subnet($tgt))
+ $new_targets[] = $tgt;
}
}
if (!isset($id))
OpenPOWER on IntegriCloud