From 1a97eb445e317637b2e01cde54bd172ed0cd8f1a Mon Sep 17 00:00:00 2001 From: Howard Wu Date: Fri, 1 Dec 2023 17:56:55 +0800 Subject: [PATCH] rockchip: don't set static ula_prefix Randomize it like https://github.com/friendlyarm/friendlywrt/blob/96e1d6736c9dbc690cf3745c6493f87f87d5e87c/package/base-files/files/etc/uci-defaults/12_network-generate-ula#L3-L10 --- target/linux/rockchip/armv8/base-files/root/setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/rockchip/armv8/base-files/root/setup.sh b/target/linux/rockchip/armv8/base-files/root/setup.sh index 6e39d7c4b40630..4fd66653207a25 100755 --- a/target/linux/rockchip/armv8/base-files/root/setup.sh +++ b/target/linux/rockchip/armv8/base-files/root/setup.sh @@ -69,8 +69,12 @@ function init_firewall() { } function init_network() { - uci set network.globals.ula_prefix='fd00:ab:cd::/48' - uci commit network + local r1 r2 r3 + r1=$(dd if=/dev/urandom bs=1 count=1 | hexdump -e '1/1 "%02x"') + r2=$(dd if=/dev/urandom bs=2 count=1 | hexdump -e '2/1 "%02x"') + r3=$(dd if=/dev/urandom bs=2 count=1 | hexdump -e '2/1 "%02x"') + uci set network.globals.ula_prefix="fd$r1:$r2:$r3::/48" + uci commit network } function init_nft-qos() {