aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/ipv6
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-06-04 17:00:32 +0200
committerHans Dedecker <dedeckeh@gmail.com>2018-06-04 17:07:29 +0200
commite4577d2e68ab8943375e719204a680cbbe3bd561 (patch)
treed73905995132726351aebfae999c13c4dd0d86de /package/network/ipv6
parent082cd951bb43188417ba8ced6e91c92ec0359c38 (diff)
downloadupstream-e4577d2e68ab8943375e719204a680cbbe3bd561.tar.gz
upstream-e4577d2e68ab8943375e719204a680cbbe3bd561.tar.bz2
upstream-e4577d2e68ab8943375e719204a680cbbe3bd561.zip
map: make tunnel encapsulation limit support configurable (FS#1501)
Be compatible with ISPs which don't support the destination option header containing the tunnel encapsulation limit as reported in FS#1501. Setting the uci parameter encaplimit to ignore; allows to disable the insertion of the destination option header in the map-e packets. Otherwise the tunnel encapsulation limit value can be set to a value from 0 till 255 by setting the encaplimit uci parameter accordingly. If no encaplimit value is specified the default value is 4 as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/ipv6')
-rw-r--r--package/network/ipv6/map/Makefile2
-rwxr-xr-xpackage/network/ipv6/map/files/map.sh16
2 files changed, 10 insertions, 8 deletions
diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile
index 77967042b3..cfb7c4ac35 100644
--- a/package/network/ipv6/map/Makefile
+++ b/package/network/ipv6/map/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=map
PKG_VERSION:=4
-PKG_RELEASE:=10
+PKG_RELEASE:=11
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh
index 42050183ce..5f4add36eb 100755
--- a/package/network/ipv6/map/files/map.sh
+++ b/package/network/ipv6/map/files/map.sh
@@ -28,9 +28,9 @@ proto_map_setup() {
# uncomment for legacy MAP0 mode
#export LEGACY=1
- local type mtu ttl tunlink zone
+ local type mtu ttl tunlink zone encaplimit
local rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset
- json_get_vars type mtu ttl tunlink zone
+ json_get_vars type mtu ttl tunlink zone encaplimit
json_get_vars rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset
[ -z "$zone" ] && zone="wan"
@@ -84,9 +84,9 @@ proto_map_setup() {
json_add_string local $(eval "echo \$RULE_${k}_IPV6ADDR")
json_add_string remote $(eval "echo \$RULE_${k}_BR")
json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE")
-
- if [ "$type" = "map-e" ]; then
- json_add_object "data"
+ json_add_object "data"
+ json_add_string encaplimit "${encaplimit:-4}"
+ if [ "$type" = "map-e" ]; then
json_add_array "fmrs"
for i in $(seq $RULE_COUNT); do
[ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue
@@ -98,8 +98,9 @@ proto_map_setup() {
json_close_object
done
json_close_array
- json_close_object
- fi
+ fi
+ json_close_object
+
proto_close_tunnel
elif [ "$type" = "map-t" -a -f "/proc/net/nat46/control" ]; then
@@ -229,6 +230,7 @@ proto_map_init_config() {
proto_config_add_int "mtu"
proto_config_add_int "ttl"
proto_config_add_string "zone"
+ proto_config_add_string "encaplimit"
}
[ -n "$INCLUDE_ONLY" ] || {