summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces.php
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2011-08-18 13:47:58 +0200
committersmos <seth.mos@dds.nl>2011-08-18 13:47:58 +0200
commit6d063da3529e47b20c4d2b7b8eb471220e23525d (patch)
treecdd14d754faf273ff2e3ba16f74fd10d4b846708 /usr/local/www/interfaces.php
parent3dda090bda2edf00b754f2d42ec690e47d047bc3 (diff)
downloadpfsense-6d063da3529e47b20c4d2b7b8eb471220e23525d.zip
pfsense-6d063da3529e47b20c4d2b7b8eb471220e23525d.tar.gz
Calculate the possible subnet ids from the delegated prefix length for the dropdown
Diffstat (limited to 'usr/local/www/interfaces.php')
-rwxr-xr-xusr/local/www/interfaces.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 7990efd..f311b77 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -1560,14 +1560,22 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<select name="dhcp6-pd-sla-id" class="formselect" id="dhcp6-pd-sla-id">
<option value="none" selected><?=gettext("None"); ?></option>
<?php
- // FIXME: Needs to calculate from prefix length from dhcp-pd
// Needs to check if the ID is not used on another interface
- for ($i = 16; $i > 0; $i--) {
- if($i <> 15) {
+ foreach($ifdescrs as $pdif => $pddescr)
+ if($config['interfaces'][$pdif]['dhcp6-ia-pd-len'] > 0) {
+ $pdlen = $config['interfaces'][$pdif]['dhcp6-ia-pd-len'];
+ continue;
+ }
+ }
+ $numbers = pow(2, $pdlen);
+ $i = 0;
+ while($i < $numbers) {
+ if($i <> $number) {
echo "<option value=\"{$i}\" ";
if ($i == $pconfig['dhcp6-pd-sla-id']) echo "selected";
echo ">" . $i . "</option>";
}
+ $i++;
}
?>
</select>
OpenPOWER on IntegriCloud