From: Liangbin Lian Date: Tue, 23 Dec 2025 07:14:46 +0000 (+0800) Subject: luci-mod-network: show "dhcpv4" option for dnsmasq X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=74d2192e83f842f6bc1058f16871d5dd1edae51b;p=openwrt-luci.git luci-mod-network: show "dhcpv4" option for dnsmasq For odhcpd, an empty "dhcpv4" is equivalent to "disabled", but for dnsmasq, an empty "dhcpv4" is equivalent to "enabled", so an empty "dhcpv4" is ambiguous. Fixes https://github.com/openwrt/openwrt/issues/21220 Signed-off-by: Liangbin Lian --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index 6312e4efe2..d184655e69 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -738,15 +738,17 @@ return view.extend({ _('As DHCP-Options; send unsolicited (dnsmasq only).')); } - if (L.hasSystemFeature('odhcpd', 'dhcpv4')) { + if (L.hasSystemFeature('odhcpd', 'dhcpv4') || L.hasSystemFeature('dnsmasq')) { so = ss.taboption('ipv4', form.RichListValue, 'dhcpv4', _('DHCPv4 Service'), - _('Enable or disable DHCPv4 services on this interface (odhcpd only).')); + _('Enable or disable DHCPv4 services on this interface.')); so.optional = true; - so.value('', _('disabled'), + so.value('disabled', _('disabled'), _('Do not provide DHCPv4 services on this interface.')); so.value('server', _('enabled'), _('Provide DHCPv4 services on this interface.')); + } + if (L.hasSystemFeature('odhcpd', 'dhcpv4')) { 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('RFC8925').format('https://www.rfc-editor.org/rfc/rfc8925'));