odhcp6c: make ds-lite/map tunnel encapsulation limit support configurable (FS#1501)
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 29 May 2018 13:31:21 +0000 (15:31 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 4 Jun 2018 15:05:28 +0000 (17:05 +0200)
Be compatible with ISPs which don't support the destination option header containing
the tunnel encapsulation limit as reported in FS#1501 for dynamic created ds-lite/map
interfaces.
Setting the uci parameter encaplimit_dslite/map to ignore; allows to disable the insertion
of the destination option header for the dynamic created ds-lite/map interface.
Otherwise the tunnel encapsulation limit value can be set to a value from 0 till 255
by setting the encaplimit_dslite/map uci parameter accordingly.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/network/ipv6/odhcp6c/Makefile
package/network/ipv6/odhcp6c/files/dhcpv6.script
package/network/ipv6/odhcp6c/files/dhcpv6.sh

index 4ecafc9276c85c24cb1c80962778a3f85c48eb57..64656dfd775b81192030649487c3b289c59dd6cc 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_RELEASE:=11
+PKG_RELEASE:=12
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
index 31710139665ae97b37e7cb540a888a22895a86a0..dcb7a95d98f8342fb7626449a11ecadb2e050e5e 100755 (executable)
@@ -170,6 +170,7 @@ setup_interface () {
                json_add_string tunlink "$INTERFACE"
                [ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE
                [ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP"
                json_add_string tunlink "$INTERFACE"
                [ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE
                [ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP"
+               [ -n "$ENCAPLIMIT_MAP" ] && json_add_string encaplimit "$ENCAPLIMIT_MAP"
                [ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
                [ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
@@ -183,6 +184,7 @@ setup_interface () {
                json_add_string tunlink "$INTERFACE"
                [ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE
                [ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE"
                json_add_string tunlink "$INTERFACE"
                [ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE
                [ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE"
+               [ -n "$ENCAPLIMIT_DSLITE" ] && json_add_string encaplimit "$ENCAPLIMIT_DSLITE"
                [ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
                [ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
index 919872fe8e3b30ae8a3baf4640f9043329749bac..000b42398c45281647428854d7a4c1dd11a66dcd 100755 (executable)
@@ -19,8 +19,10 @@ proto_dhcpv6_init_config() {
        proto_config_add_array 'ip6prefix:list(ip6addr)'
        proto_config_add_string iface_dslite
        proto_config_add_string zone_dslite
        proto_config_add_array 'ip6prefix:list(ip6addr)'
        proto_config_add_string iface_dslite
        proto_config_add_string zone_dslite
+       proto_config_add_string encaplimit_dslite
        proto_config_add_string iface_map
        proto_config_add_string zone_map
        proto_config_add_string iface_map
        proto_config_add_string zone_map
+       proto_config_add_string encaplimit_map
        proto_config_add_string iface_464xlat
        proto_config_add_string zone_464xlat
        proto_config_add_string zone
        proto_config_add_string iface_464xlat
        proto_config_add_string zone_464xlat
        proto_config_add_string zone
@@ -48,8 +50,8 @@ proto_dhcpv6_setup() {
        local config="$1"
        local iface="$2"
 
        local config="$1"
        local iface="$2"
 
-       local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
-       json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
+       local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
+       json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
        json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes
 
        # Configure
        json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes
 
        # Configure
@@ -98,6 +100,8 @@ proto_dhcpv6_setup() {
        [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
        [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat"
        [ -n "$zone" ] && proto_export "ZONE=$zone"
        [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
        [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat"
        [ -n "$zone" ] && proto_export "ZONE=$zone"
+       [ -n "$encaplimit_dslite" ] && proto_export "ENCAPLIMIT_DSLITE=$encaplimit_dslite"
+       [ -n "$encaplimit_map" ] && proto_export "ENCAPLIMIT_MAP=$encaplimit_map"
        [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"
        [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1"
        [ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1"
        [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"
        [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1"
        [ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1"