summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShine2026-06-29 07:23:45 +0000
committerRobert Marko2026-06-29 12:51:08 +0000
commit481e0a16f458bfb6e1783a8532df40c769018b1b (patch)
treee09392c6c03d57e23114e1b46e29ed319a20402d
parentebae538f22ded62e69324d7bacb2148f6762ba80 (diff)
downloadopenwrt-481e0a16f458bfb6e1783a8532df40c769018b1b.tar.gz
scripts: dhcpv6: don't report custom ip6class if default
odhcp6c returns delegated prefixes with a "class=<IAID>" tag if a custom IAID was specified in the -P argument. This tag must then be used for any prefix filter ("network.<interface>.ip6class") instead of the uplink i/f name. OpenWrt by default uses the first eight digits of the uplink i/f name's MD5 hash as IAID. Don't report a custom "class" tag for this default IAID. Fixes: f08cd5ce5d66d76fa6e282d6e3f29bab9cdf8023 Signed-off-by: Shine <4c.fce2@proton.me> Tested-by: Goetz Goerisch <ggoerisch@gmail.com> Link: https://github.com/openwrt/openwrt/pull/23989 Signed-off-by: Robert Marko <robimarko@gmail.com> (cherry picked from commit 257aee0cc0306de8bae6b3095908983c3db856d5)
-rwxr-xr-xpackage/network/ipv6/odhcp6c/files/dhcpv6.script4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 94f1952ecc..189bd4fea5 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -1,10 +1,12 @@
#!/bin/sh
[ -z "$2" ] && echo "Error: should be run by odhcpc6c" && exit 1
. /lib/functions.sh
+. /lib/functions/network.sh
. /lib/netifd/netifd-proto.sh
setup_interface () {
local device="$1"
+ local iaid
local prefsig=""
local addrsig=""
@@ -42,7 +44,9 @@ setup_interface () {
proto_add_dns_search "$domain"
done
+ network_generate_iface_iaid iaid "$device"
for prefix in $PREFIXES; do
+ prefix="${prefix/,class=$iaid/}"
proto_add_ipv6_prefix "$prefix"
prefsig="$prefsig ${prefix%%,*}"
local entry="${prefix#*/}"