summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_routes_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-04-10 08:07:07 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-04-10 08:07:07 -0300
commit8543a5bbe2037c9214f967806f417c7c4ba3b062 (patch)
tree8841722ca000796f3066d58f230059d89159eff6 /usr/local/www/system_routes_edit.php
parent87f611017953aadb5db66ded7d27724786b0d118 (diff)
downloadpfsense-8543a5bbe2037c9214f967806f417c7c4ba3b062.zip
pfsense-8543a5bbe2037c9214f967806f417c7c4ba3b062.tar.gz
Prohibit adding aliases containing FQDNs in static routes. Fixes #2941
Diffstat (limited to 'usr/local/www/system_routes_edit.php')
-rwxr-xr-xusr/local/www/system_routes_edit.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index cd85c4e..28649e0 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -125,7 +125,15 @@ if ($_POST) {
}
} elseif (is_alias($_POST['network'])) {
$osn = $_POST['network'];
+ $fqdn_found = 0;
foreach (filter_expand_alias_array($_POST['network']) as $tgt) {
+ if (!is_ipaddr($tgt) && is_hostname($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;
+ }
if (is_ipaddrv4($tgt))
$tgt .= "/32";
if (is_ipaddrv6($tgt))
OpenPOWER on IntegriCloud