Skip to content

Commit 010575c

Browse files
emi-YFcz5XDjrobimarko
authored andcommitted
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. <[email protected]>
1 parent 412bc7e commit 010575c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package/base-files/files/etc/uci-defaults/14_network-generate-clientid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
uci -q batch <<-EOF >/dev/null
44
# DUID-UUID - RFC6355
5-
set network.globals.dhcp_default_duid="$(hexdump -vn 16 -e '"0004" 2/2 "%x"' /dev/urandom)"
5+
set network.globals.dhcp_default_duid="$(printf '%s%s' '0004' $(cat /proc/sys/kernel/random/uuid | sed -e 's/-//g'))"
66
commit network
77
EOF
88

0 commit comments

Comments
 (0)