diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index a664aa13aa..4a3b1b272c 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -149,6 +149,11 @@ setup_interface () { proto_send_update "$INTERFACE" + # If the flag '$DYNAMIC' is set to '0' (default=1), then the dynamic + # interfaces for the proto 'map', 'dslite' or '464xlat' are not + # created, even if the requirements are met. + [ "$DYNAMIC" = 0 ] && return + MAPTYPE="" MAPRULE="" diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh index e6d8746a8d..59a6021c5c 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -43,6 +43,7 @@ proto_dhcpv6_init_config() { proto_config_add_boolean keep_ra_dnslifetime proto_config_add_int "ra_holdoff" proto_config_add_boolean verbose + proto_config_add_boolean dynamic } proto_dhcpv6_add_prefix() { @@ -63,7 +64,7 @@ proto_dhcpv6_setup() { local iface_map iface_464xlat ip6ifaceid userclass vendorclass local delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite local encaplimit_map skpriority soltimeout fakeroutes sourcefilter - local keep_ra_dnslifetime ra_holdoff verbose mtu_dslite + local keep_ra_dnslifetime ra_holdoff verbose mtu_dslite dynamic local ip6prefix ip6prefixes @@ -73,7 +74,7 @@ proto_dhcpv6_setup() { json_get_vars iface_map iface_464xlat ip6ifaceid userclass vendorclass json_get_vars delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite json_get_vars encaplimit_map skpriority soltimeout fakeroutes sourcefilter - json_get_vars keep_ra_dnslifetime ra_holdoff verbose mtu_dslite + json_get_vars keep_ra_dnslifetime ra_holdoff verbose mtu_dslite dynamic json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes @@ -154,6 +155,12 @@ proto_dhcpv6_setup() { [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1" [ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1" + if [ "$dynamic" = 0 ]; then + proto_export "DYNAMIC=0" + else + proto_export "DYNAMIC=1" + fi + proto_export "INTERFACE=$config" proto_run_command "$config" odhcp6c \ -s /lib/netifd/dhcpv6.script \