Skip to content

Commit 65bd273

Browse files
committed
Services: Kea DHCP: Kea DHCPv6 - add advanced options [pd-]allocator, closes #8677
1 parent e996311 commit 65bd273

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet6.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
<type>dropdown</type>
1212
<help>Select which interface this subnet belongs too.</help>
1313
</field>
14+
<field>
15+
<id>subnet6.allocator</id>
16+
<label>Allocator</label>
17+
<type>dropdown</type>
18+
<advanced>true</advanced>
19+
<help>Select allocator method to use when offering leases to clients.</help>
20+
</field>
21+
<field>
22+
<id>subnet6.pd-allocator</id>
23+
<label>PD Allocator</label>
24+
<type>dropdown</type>
25+
<advanced>true</advanced>
26+
<help>Select allocator method to use when offering prefix delegations to clients</help>
27+
</field>
1428
<field>
1529
<id>subnet6.description</id>
1630
<label>Description</label>

src/opnsense/mvc/app/models/OPNsense/Kea/KeaDhcpv6.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ private function getConfigSubnets()
133133
if (isset($cfg->interfaces->$if) && !empty($cfg->interfaces->$if->if)) {
134134
$record['interface'] = (string)$cfg->interfaces->$if->if;
135135
}
136+
if (!$subnet->{'pd-allocator'}->isEmpty()) {
137+
$record['pd-allocator'] = (string)$subnet->{'pd-allocator'};
138+
}
139+
if (!$subnet->allocator->isEmpty()) {
140+
$record['allocator'] = (string)$subnet->allocator;
141+
}
136142
/* standard option-data elements */
137143
foreach ($subnet->option_data->iterateItems() as $key => $value) {
138144
$target_fieldname = str_replace('_', '-', $key);

src/opnsense/mvc/app/models/OPNsense/Kea/KeaDhcpv6.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@
4343
<AddressFamily>ipv6</AddressFamily>
4444
<Required>Y</Required>
4545
</subnet>
46+
<allocator type="OptionField">
47+
<BlankDesc>Default</BlankDesc>
48+
<OptionValues>
49+
<iterative>iterative</iterative>
50+
<random>random</random>
51+
</OptionValues>
52+
</allocator>
53+
<pd-allocator type="OptionField">
54+
<BlankDesc>Default</BlankDesc>
55+
<OptionValues>
56+
<iterative>iterative</iterative>
57+
<random>random</random>
58+
<flq>Free Lease Queue Allocator</flq>
59+
</OptionValues>
60+
</pd-allocator>
4661
<option_data>
4762
<dns_servers type="NetworkField">
4863
<NetMaskAllowed>N</NetMaskAllowed>

0 commit comments

Comments
 (0)