[openwrt/openwrt] odhcp6c: use the global DHCP DUID for DHCPv6
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 19 10:46:27 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7dee632beedbee923c0f993d8e332a8bb3677cc8
commit 7dee632beedbee923c0f993d8e332a8bb3677cc8
Author: David Härdeman <david at hardeman.nu>
AuthorDate: Fri Oct 10 11:43:11 2025 +0200
odhcp6c: use the global DHCP DUID for DHCPv6
odhcp6c already supports custom DUIDS on a per-interface basis. When no client
identifier has been set, odhcp6c will generate one on the basis of the MAC
address of the given interface.
This is contrary to how DUIDs are meant to be used, as the client identifier
will vary from interface to interface, while it is meant to remain stable for a
given host, no matter how the network hardware changes (see RFC8415, §11).
Fix this by letting odhcp6c use the global DHCP DUID, if configured.
Signed-off-by: David Härdeman <david at hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/20359
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
package/network/ipv6/odhcp6c/files/dhcpv6.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index e8d07ebaa7..00dd610dfa 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -2,6 +2,7 @@
. /lib/functions.sh
. ../netifd-proto.sh
+. /lib/config/uci.sh
init_proto "$@"
proto_dhcpv6_init_config() {
@@ -66,6 +67,7 @@ proto_dhcpv6_setup() {
[ -z "$reqprefix" -o "$reqprefix" = "auto" ] && reqprefix=0
[ "$reqprefix" != "no" ] && append opts "-P$reqprefix"
+ [ -z "$clientid" ] && clientid="$(uci_get network @globals[0] dhcp_default_duid)"
[ -n "$clientid" ] && append opts "-c$clientid"
[ "$defaultreqopts" = "0" ] && append opts "-R"
More information about the lede-commits
mailing list