odhcp6c: add route-workaround for broken IPv6-ISPs
[openwrt/staging/chunkeey.git] / package / network / ipv6 / odhcp6c / files / dhcpv6.sh
index 90a83718e527120d5b0f33c450f4db47ad7492d0..5914abe0bb61632b528336b77b0c0899b72301af 100755 (executable)
@@ -17,19 +17,24 @@ proto_dhcpv6_init_config() {
        proto_config_add_string 'ip6prefix:ip6addr'
        proto_config_add_string iface_dslite
        proto_config_add_string zone_dslite
+       proto_config_add_string iface_map
+       proto_config_add_string zone_map
+       proto_config_add_string zone
        proto_config_add_string 'ifaceid:ip6addr'
        proto_config_add_string 'sourcerouting:bool'
        proto_config_add_string "userclass"
        proto_config_add_string "vendorclass"
        proto_config_add_boolean delegate
+       proto_config_add_int "soltimeout"
+       proto_config_add_boolean fakeroutes
 }
 
 proto_dhcpv6_setup() {
        local config="$1"
        local iface="$2"
 
-       local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting userclass vendorclass delegate zone_dslite
-       json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting userclass vendorclass delegate zone_dslite
+       local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout fakeroutes
+       json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout fakeroutes
 
 
        # Configure
@@ -57,11 +62,18 @@ proto_dhcpv6_setup() {
                append opts "-r$opt"
        done
 
+       append opts "-t${soltimeout:-120}"
+
        [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
        [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
+       [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map"
        [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1"
        [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0"
+       [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0"
        [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite"
+       [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
+       [ -n "$zone" ] && proto_export "ZONE=$zone"
+       [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"
 
        proto_export "INTERFACE=$config"
        proto_run_command "$config" odhcp6c \