luci-mod-network: add IPv6-only preferred option
authorDavid Härdeman <[email protected]>
Sun, 30 Nov 2025 15:47:48 +0000 (16:47 +0100)
committerDavid Härdeman <[email protected]>
Sun, 30 Nov 2025 15:58:42 +0000 (16:58 +0100)
This adds support for the IPv6-only preferred (RFC8925) option to LuCI.

The option is supported by odhcpd since commit
338ca8abb950e4e0448a13d50d6d6567a167d016

Signed-off-by: David Härdeman <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index 44fc0df706acd0fb4bb8b6f054312832b30a93db..e9fe9d74d1c7a5423097b620180d679526c0efb6 100644 (file)
@@ -746,6 +746,13 @@ return view.extend({
                                                                 _('Do not provide DHCPv4 services on this interface.'));
                                                        so.value('server', _('enabled'),
                                                                 _('Provide DHCPv4 services on this interface.'));
+
+                                                       so = ss.taboption('ipv4', form.Value, 'ipv6_only_preferred', _('IPv6-Only Preferred'),
+                                                               _('Specifies how often (in seconds) clients should check whether IPv6-only mode is still preferred (see %s, odhcpd only).')
+                                                               .format('<a href="%s" target="_blank">RFC8925</a>').format('https://www.rfc-editor.org/rfc/rfc8925'));
+                                                       so.optional = true;
+                                                       so.datatype = 'or(0, range(300,86400))';
+                                                       so.default = '0';
                                                }
 
                                                so = ss.taboption('ipv4', form.Value, 'start', _('Start', 'DHCP IP range start address'), _('Lowest leased address as offset from the network address.'));