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>
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
+proto_6in4_add_prefix() {
+ append "$3" "$1"
+}
+
proto_6in4_setup() {
local cfg="$1"
local iface="$2"
local link="6in4-$cfg"
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"
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
}
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"
proto_add_ipv6_prefix "$ip6prefix"
proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
proto_add_tunnel
json_add_string mode sit
proto_add_tunnel
json_add_string mode sit
proto_config_add_string "ipaddr"
proto_config_add_string "ip6addr"
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"
proto_config_add_string "peeraddr"
proto_config_add_string "tunlink"
proto_config_add_string "tunnelid"