summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcpv6.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-02-19 10:49:27 -0200
committerRenato Botelho <renato@netgate.com>2016-02-19 10:57:32 -0200
commit6c8beed3454f3b262dbf7380f9ff94cdede24bdf (patch)
treedfd633ed6e8fe81a3df1c7f84c90109ec685a17f /src/usr/local/www/services_dhcpv6.php
parent15db02a6abe5c0af41174c08a41a50e3c9eb9018 (diff)
downloadpfsense-6c8beed3454f3b262dbf7380f9ff94cdede24bdf.zip
pfsense-6c8beed3454f3b262dbf7380f9ff94cdede24bdf.tar.gz
Ticket #3029
Fix DHCPv6 GUI to work with PD length != 64
Diffstat (limited to 'src/usr/local/www/services_dhcpv6.php')
-rw-r--r--src/usr/local/www/services_dhcpv6.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php
index ea80ac4..0a9b2e8 100644
--- a/src/usr/local/www/services_dhcpv6.php
+++ b/src/usr/local/www/services_dhcpv6.php
@@ -153,8 +153,12 @@ if (is_array($config['dhcpdv6'][$if])) {
}
if ($config['interfaces'][$if]['ipaddrv6'] == 'track6') {
+ $trackifname = $config['interfaces'][$if]['track6-interface'];
+ $trackcfg = $config['interfaces'][$trackifname];
+ $ifcfgsn = 64 - $trackcfg['dhcp6-ia-pd-len'];
$ifcfgip = '::';
- $ifcfgsn = 64;
+
+ $str_help_mask = dhcpv6_pd_str_help($ifcfgsn);
} else {
$ifcfgip = get_interface_ipv6($if);
$ifcfgsn = get_interface_subnetv6($if);
@@ -244,16 +248,20 @@ if ($_POST) {
if (!is_ipaddrv6($_POST['range_from'])) {
$input_errors[] = gettext("A valid range must be specified.");
} elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' &&
- !Net_IPv6::isInNetmask($_POST['range_from'], '::', 64)) {
- $input_errors[] = gettext("The prefix (upper 64 bits) must be zero. Use the form ::x:x:x:x");
+ !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);
}
}
if ($_POST['range_to']) {
if (!is_ipaddrv6($_POST['range_to'])) {
$input_errors[] = gettext("A valid range must be specified.");
} elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' &&
- !Net_IPv6::isInNetmask($_POST['range_to'], '::', 64)) {
- $input_errors[] = gettext("The prefix (upper 64 bits) must be zero. Use the form ::x:x:x:x");
+ !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);
}
}
if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway']))) {
OpenPOWER on IntegriCloud