Skip to content

luci-mod-network: honor the DHCPv6-PD default - #9211

Merged
systemcrash merged 2 commits into
openwrt:masterfrom
lucas-albers-lz4:fix-dhcpv6-pd-default
Nov 16, 2026
Merged

systemcrash merged 2 commits into
openwrt:masterfrom
lucas-albers-lz4:fix-dhcpv6-pd-default

Conversation

@lucas-albers-lz4

Copy link
Copy Markdown
Contributor

Description

odhcpd enables DHCPv6 prefix delegation when dhcpv6_pd is absent, but LuCI treats the unchecked state as the default. Unchecking DHCPv6-PD therefore removes the option and leaves prefix delegation enabled.

Set the flag's default to enabled so the UI reflects odhcpd and disabling it writes 0. Retain an explicit value when a DHCPv6 mode change hides the control, so changing modes does not discard the disabled setting.

Refs #8982

Tested on

OpenWrt 25.12.5 x86-64 (r33051-f5dae5ece4) rootfs containers; Chrome with Playwright. Reproduced deletion of dhcpv6_pd when unchecking the original flag. With the modified view, checked initial absent, 1, and 0 states; verified that disabling stages 0, re-enabling stages removal, and Save & Apply writes 0. Confirmed a fresh container with committed 0 renders unchecked. Switching server to relay with a committed 0 retained the setting; that mode-selector check used programmatic DOM clicks because the modal intercepted pointer events.

Separately, on an isolated Docker IPv6 network with OpenWrt 25.12.5 odhcpd and a downstream odhcp6c client, a fresh IA_PD request received a /62 with the option absent, received no delegated prefix with 0, and received a /62 again with 1. These backend settings were changed directly through UCI; the UI and client exchange were not tested as one continuous run. No physical router was tested.

odhcpd enables prefix delegation when dhcpv6_pd is absent, while the
LuCI flag defaults to disabled. Unchecking it removes the option and
therefore leaves delegation enabled.

Use the backend default for the flag and preserve an explicit setting
when the DHCPv6 mode changes and the control is hidden.

Signed-off-by: Lucas Albers <lucas.b.albers@gmail.com>
@GoetzGoerisch

Copy link
Copy Markdown

I tried to test this.
It still deletes option dhcpv6_pd when disabling in LuCI.

@lucas-albers-lz4

Copy link
Copy Markdown
Contributor Author

I retested this on OpenWrt 25.12.6 with Playwright.

Stock LuCI (flag default disabled) does what you saw: unchecking an explicit dhcpv6_pd='1' stages uci del dhcp.lan.dhcpv6_pd.

With this PR's interfaces.js loaded, the same uncheck stages uci set dhcp.lan.dhcpv6_pd='0'. That also happens when the option was absent (shown checked because odhcpd defaults to enabled).

Please hard-refresh after replacing /www/luci-static/resources/view/network/interfaces.js, then Save the interface modal and check Unsaved Changes. Disabling should show uci set dhcp.lan.dhcpv6_pd='0', not uci del. If you still get a delete, which image and file are you running?

@GoetzGoerisch

Copy link
Copy Markdown

Thank you, retest works as describe.
But IMHO the behavior should be fixed in odhcpd in the first place. @Alphix what do you think?

@Alphix

Alphix commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

...But IMHO the behavior should be fixed in odhcpd in the first place. @Alphix what do you think?

Nah, odhcpd defaults to allowing DHCPv6-PD, that's been like that since the option was introduced (commit 7abbed4), and every config without the option relies on it. LuCI's ideas of the default just happens to not match reality. So this is a good fix.

@GoetzGoerisch

Copy link
Copy Markdown

Thank you @Alphix for your feedback.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commits; no new issues found.


Generated by Claude Code

Also show the prefix-delegation flag and minimum length when DHCPv6 is
in hybrid mode on a non-master interface, matching the other DHCPv6
options.

Signed-off-by: Lucas Albers <lucas.b.albers@gmail.com>

@Alphix Alphix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commits; no new issues found.


Generated by Claude Code

@GoetzGoerisch GoetzGoerisch left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@lucas-albers-lz4

Copy link
Copy Markdown
Contributor Author

@jow- This is ready when you have a moment: two approvals (including the odhcpd/LuCI default review) and CI is green. Small luci-mod-network change to match the default DHCPv6-PD option.

@systemcrash
systemcrash merged commit 6506ac4 into openwrt:master Nov 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants