aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-08-27 18:52:57 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-08-29 21:10:39 +0200
commit1b3ded7225e86988a48804e5efaa05bf25084d80 (patch)
tree028bfc958263b502d8220aabe17d7223f169cce9 /package
parent2f0a8558be01e1c82b7507112fe23f6662711135 (diff)
downloadupstream-1b3ded7225e86988a48804e5efaa05bf25084d80.tar.gz
upstream-1b3ded7225e86988a48804e5efaa05bf25084d80.tar.bz2
upstream-1b3ded7225e86988a48804e5efaa05bf25084d80.zip
map: use nested json data object to store map-e fmrs parameters
Replace the string array containing the fmrs parameters by a nested data json object holding an array of fmrs parameters Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/network/ipv6/map/Makefile2
-rwxr-xr-xpackage/network/ipv6/map/files/map.sh16
2 files changed, 11 insertions, 7 deletions
diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile
index c4f62a9d17..ce04235f28 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:=8
+PKG_RELEASE:=9
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 e0dc034ce9..42050183ce 100755
--- a/package/network/ipv6/map/files/map.sh
+++ b/package/network/ipv6/map/files/map.sh
@@ -86,15 +86,19 @@ proto_map_setup() {
json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE")
if [ "$type" = "map-e" ]; then
- json_add_array "fmrs"
+ json_add_object "data"
+ json_add_array "fmrs"
for i in $(seq $RULE_COUNT); do
[ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue
- fmr="$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")"
- fmr="$fmr,$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")"
- fmr="$fmr,$(eval "echo \$RULE_${i}_EALEN"),$(eval "echo \$RULE_${i}_OFFSET")"
- json_add_string "" "$fmr"
+ json_add_object ""
+ json_add_string prefix6 "$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")"
+ json_add_string prefix4 "$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")"
+ json_add_int ealen $(eval "echo \$RULE_${i}_EALEN")
+ json_add_int offset $(eval "echo \$RULE_${i}_OFFSET")
+ json_close_object
done
- json_close_array
+ json_close_array
+ json_close_object
fi
proto_close_tunnel