[openwrt/openwrt] base-files: correct global DHCP DUID generation

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 8 07:30:44 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/010575c617dfbbe533f19cf358871fe655e5534c

commit 010575c617dfbbe533f19cf358871fe655e5534c
Author: Alice H. <alice.hall0451+github at gmail.com>
AuthorDate: Sat Nov 8 04:39:42 2025 +0000

    base-files: correct global DHCP DUID generation
    
    The old command generates an often incorrect variable length UUID
    instead of a fixed 16-octet hex string.
    
    Ref: https://datatracker.ietf.org/doc/html/rfc8415#section-11.5
    
    Signed-off-by: Alice H. <alice.hall0451+github at gmail.com>
---
 package/base-files/files/etc/uci-defaults/14_network-generate-clientid | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid b/package/base-files/files/etc/uci-defaults/14_network-generate-clientid
index 70da185c20..11806dd19c 100644
--- a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid
+++ b/package/base-files/files/etc/uci-defaults/14_network-generate-clientid
@@ -2,7 +2,7 @@
 
 uci -q batch <<-EOF >/dev/null
 	# DUID-UUID - RFC6355
-	set network.globals.dhcp_default_duid="$(hexdump -vn 16 -e '"0004" 2/2 "%x"' /dev/urandom)"
+	set network.globals.dhcp_default_duid="$(printf '%s%s' '0004' $(cat /proc/sys/kernel/random/uuid | sed -e 's/-//g'))"
 	commit network
 EOF
 




More information about the lede-commits mailing list