aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/ipv6
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-02-14 14:58:08 +0100
committerHans Dedecker <dedeckeh@gmail.com>2018-03-13 18:27:41 +0100
commite83bc5e3c7531fe1a4ac090d49235274ba04b417 (patch)
tree937d329da95da02c303c2b5fd1919e5286ee7019 /package/network/ipv6
parent50433f313f763361e85761fae3de12097dedd20a (diff)
downloadupstream-e83bc5e3c7531fe1a4ac090d49235274ba04b417.tar.gz
upstream-e83bc5e3c7531fe1a4ac090d49235274ba04b417.tar.bz2
upstream-e83bc5e3c7531fe1a4ac090d49235274ba04b417.zip
6in4: support multiple additional user prefixes
Support configuration in the form... list ip6prefix 2001:db8:1234::/64 list ip6prefix 2001:db8:5678::/64 ... to allow specifying multiple routed IPv6 prefixes. Implements feature request FS#1361. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/ipv6')
-rw-r--r--package/network/ipv6/6in4/Makefile2
-rwxr-xr-xpackage/network/ipv6/6in4/files/6in4.sh15
2 files changed, 11 insertions, 6 deletions
diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile
index 34227ce9ef..8ff4730e74 100644
--- a/package/network/ipv6/6in4/Makefile
+++ b/package/network/ipv6/6in4/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
-PKG_VERSION:=24
+PKG_VERSION:=25
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh
index 786f37fc14..941dc43d68 100755
--- a/package/network/ipv6/6in4/files/6in4.sh
+++ b/package/network/ipv6/6in4/files/6in4.sh
@@ -22,13 +22,18 @@ proto_6in4_update() {
' "$1" "$@"
}
+proto_6in4_add_prefix() {
+ append "$3" "$1"
+}
+
proto_6in4_setup() {
local cfg="$1"
local iface="$2"
local link="6in4-$cfg"
- local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunlink tunnelid username password updatekey
- json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunlink tunnelid username password updatekey
+ local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey
+ json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey
+ json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
@@ -61,10 +66,10 @@ proto_6in4_setup() {
proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
}
- [ -n "$ip6prefix" ] && {
+ for ip6prefix in $ip6prefixes; do
proto_add_ipv6_prefix "$ip6prefix"
proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
- }
+ done
proto_add_tunnel
json_add_string mode sit
@@ -122,7 +127,7 @@ proto_6in4_init_config() {
proto_config_add_string "ipaddr"
proto_config_add_string "ip6addr"
- proto_config_add_string "ip6prefix"
+ proto_config_add_array "ip6prefix"
proto_config_add_string "peeraddr"
proto_config_add_string "tunlink"
proto_config_add_string "tunnelid"