]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
odhcp6c: Conditionally request S46 OROs
authorShengyu Qu <wiagn233@outlook.com>
Thu, 15 May 2025 03:38:46 +0000 (11:38 +0800)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tue, 3 Jun 2025 16:30:57 +0000 (17:30 +0100)
Request Softwire46 (S46) [RFC 7598] options when the map and/or ds-lite
packages are installed. This is required as the behaviour of odhcp6c has
changed to not include these OROs by default.

See openwrt/odhcp6c#89

Signed-off-by: Richard Patterson <richard@helix.net.nz>
Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
package/network/ipv6/odhcp6c/files/dhcpv6.sh

index 18c24febd614b0c9aa4b6d70e7eaa7696a361e54..e8d07ebaa79bf465cdb875d56a3c709cb9f6f7f2 100755 (executable)
@@ -96,13 +96,23 @@ proto_dhcpv6_setup() {
 
        [ "$verbose" = "1" ] && append opts "-v"
 
+       json_for_each_item proto_dhcpv6_add_sendopts sendopts opts
+
+       # Dynamically add OROs to support loaded packages.
+       json_load "$(ubus call network get_proto_handlers)"
+       json_get_var handler_map map
+       json_get_var handler_dslite dslite
+
+       [ -n "$handler_dslite" ] && append reqopts "64"
+       [ -n "$handler_map" ] && append reqopts "94"
+       [ -n "$handler_map" ] && append reqopts "95"
+       [ -n "$handler_map" ] && append reqopts "96"
+
        local opt
        for opt in $reqopts; do
                append opts "-r$opt"
        done
 
-       json_for_each_item proto_dhcpv6_add_sendopts sendopts opts
-
        append opts "-t${soltimeout:-120}"
 
        [ -n "$ip6prefixes" ] && proto_export "USERPREFIX=$ip6prefixes"