summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-10-24 20:23:00 +0545
committerPhil Davis <phil.davis@inf.org>2014-10-24 20:23:00 +0545
commit577b776e556f68234d6657b210ec2d150a66d6e6 (patch)
treee5b54e8cbf0f19f5745aa600a185cc863958756f
parentbb67ac32bc2a27321cc7c0b2d24f9adc9639584d (diff)
downloadpfsense-577b776e556f68234d6657b210ec2d150a66d6e6.zip
pfsense-577b776e556f68234d6657b210ec2d150a66d6e6.tar.gz
Warn if attempting to import IPv6 range
There is currently no code to convert an IPv6 range to a set of corresponding IPv6 subnets, so warn the user if they attempt that from the alias bulk import GUI.
-rwxr-xr-xusr/local/www/firewall_aliases_import.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php
index f744441..f7c259e 100755
--- a/usr/local/www/firewall_aliases_import.php
+++ b/usr/local/www/firewall_aliases_import.php
@@ -101,12 +101,15 @@ if($_POST['aliasimport'] <> "") {
$impdesc = trim($implinea[1]);
if (strlen($impdesc) < 200) {
if ((strpos($impdesc, "||") === false) && (substr($impdesc, 0, 1) != "|") && (substr($impdesc, -1, 1) != "|")) {
- if (is_iprange($impip)) {
+ $iprange_type = is_iprange($impip);
+ if ($iprange_type == 4) {
list($startip, $endip) = explode('-', $impip);
$rangesubnets = ip_range_to_subnet_array($startip, $endip);
$imported_ips = array_merge($imported_ips, $rangesubnets);
$rangedescs = array_fill(0, count($rangesubnets), $impdesc);
$imported_descs = array_merge($imported_descs, $rangedescs);
+ } else if ($iprange_type == 6) {
+ $input_errors[] = sprintf(gettext('IPv6 address ranges are not supported (%s)'), $impip);
} else if (!is_ipaddr($impip) && !is_subnet($impip) && !is_hostname($impip) && !empty($impip)) {
$input_errors[] = sprintf(gettext("%s is not an IP address. Please correct the error to continue"), $impip);
} elseif (!empty($impip)) {
OpenPOWER on IntegriCloud