luci-proto-ipv6: dhcpv6: add option to select the DHCPv6 client ID

OpenWrt gained a per-interface "sendclientid" option which overrides the
preferred DUID used for DHCPv6 requests. Expose it in the advanced
settings of the DHCPv6 client protocol:

- "auto" (default) uses the explicitly configured client ID, or falls
  back to the global default DUID and finally a DUID-LL derived from the
  interface MAC address
- "global" always uses the global default DUID
- "hardware" passes no client ID to odhcp6c, so a type 3 DUID-LL is used

Unlike DHCPv4 there is no "none" mode, as odhcp6c always sends a client
identifier. The explicit client ID is only evaluated in "auto" mode,
hence it now depends on that setting.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Hauke Mehrtens authored and Jo-Philipp Wich committed 2026-07-21 23:02:15 +02:00
1 parent ed23f07d9f
commit 4a78eccd90
1 file changed
+11
@@ -38,7 +38,18 @@ return network.registerProtocol('dhcpv6', {
o.default = '1';
o.rmempty = false;
o = s.taboption('advanced', form.ListValue, 'sendclientid', _('Preferred client ID'),
_('Selects the <abbr title="DHCP Unique Identifier">DUID</abbr> to send when requesting DHCPv6.') + '<br />' +
_('<em>Automatic</em> uses the client ID configured below, else the default DUID of this device, else a DUID-LL derived from the MAC address of this interface.') + '<br />' +
_('<em>Default DUID</em> always uses the default DUID of this device, even if a client ID is configured below.') + '<br />' +
_('<em>Hardware address</em> always uses a DUID-LL derived from the MAC address of this interface.'));
o.value('auto', _('Automatic'));
o.value('global', _('Default DUID'));
o.value('hardware', _('Hardware address'));
o.default = 'auto';
o = s.taboption('advanced', form.Value, 'clientid', _('Client ID to send when requesting DHCP'));
o.datatype = 'hexstring';
o.depends('sendclientid', 'auto');
}
});