diff options
author | Phil Davis <phil.davis@inf.org> | 2016-10-13 11:52:59 +0930 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-10-13 10:39:48 -0300 |
commit | 2329b5a8dab6847db24d892a4c00b0f11cabba64 (patch) | |
tree | b20a3d56134ef542d8eb0bee481ccb15552d1159 /src/usr/local/www/services_dhcpv6.php | |
parent | 004b752e2e0af288024de8a251e74f8e1d94b96d (diff) | |
download | pfsense-2329b5a8dab6847db24d892a4c00b0f11cabba64.zip pfsense-2329b5a8dab6847db24d892a4c00b0f11cabba64.tar.gz |
DHCPV6 only check VIPs in range if range valid
If the user has input invalid values into range from and to, then there
is no point checking any IPv6 VIPs to see if they fall in the range.
None of them would be "in range" because the specified range is not even
valid.
(cherry picked from commit 3707ffc4157408b498d3b84d64918d4e41b5a123)
Diffstat (limited to 'src/usr/local/www/services_dhcpv6.php')
-rw-r--r-- | src/usr/local/www/services_dhcpv6.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php index d54e386..b9c6f4c 100644 --- a/src/usr/local/www/services_dhcpv6.php +++ b/src/usr/local/www/services_dhcpv6.php @@ -276,24 +276,30 @@ if (isset($_POST['apply'])) { } } + $range_from_to_ok = true; + if ($_POST['range_from']) { if (!is_ipaddrv6($_POST['range_from'])) { $input_errors[] = gettext("A valid range must be specified."); + $range_from_to_ok = false; } elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' && !Net_IPv6::isInNetmask($_POST['range_from'], '::', $ifcfgsn)) { $input_errors[] = sprintf(gettext( "The prefix (upper %s bits) must be zero. Use the form %s"), $ifcfgsn, $str_help_mask); + $range_from_to_ok = false; } } if ($_POST['range_to']) { if (!is_ipaddrv6($_POST['range_to'])) { $input_errors[] = gettext("A valid range must be specified."); + $range_from_to_ok = false; } elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' && !Net_IPv6::isInNetmask($_POST['range_to'], '::', $ifcfgsn)) { $input_errors[] = sprintf(gettext( "The prefix (upper %s bits) must be zero. Use the form %s"), $ifcfgsn, $str_help_mask); + $range_from_to_ok = false; } } if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway']))) { @@ -346,7 +352,7 @@ if (isset($_POST['apply'])) { } // Disallow a range that includes the virtualip - if (is_array($config['virtualip']['vip'])) { + if ($range_from_to_ok && is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $vip) { if ($vip['interface'] == $if) { if ($vip['subnetv6'] && is_inrange_v6($vip['subnetv6'], $_POST['range_from'], $_POST['range_to'])) { |