odhcp6c: rework sendopts handling
authorHans Dedecker <dedeckeh@gmail.com>
Sat, 24 Feb 2018 19:59:10 +0000 (20:59 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 24 Feb 2018 20:04:06 +0000 (21:04 +0100)
Bring logic of sendopts handling in line with ip6prefix handling

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

index 8abb63317fa750589c30b4809f741cde8cb9506e..3d6d944791ecd83c8c5b5683bb240573a10aaf0c 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
index 54e51065f65a79382d605999725fe6f26aa17095..919872fe8e3b30ae8a3baf4640f9043329749bac 100755 (executable)
@@ -40,6 +40,10 @@ proto_dhcpv6_add_prefix() {
        append "$3" "$1"
 }
 
+proto_dhcpv6_add_sendopts() {
+       [ -n "$1" ] && append "$3" "-x$1"
+}
+
 proto_dhcpv6_setup() {
        local config="$1"
        local iface="$2"
@@ -80,12 +84,7 @@ proto_dhcpv6_setup() {
                append opts "-r$opt"
        done
 
-       sendopts_cb() {
-               local val="$1"
-               [ -n "$val" ] && append opts "-x$val"
-       }
-
-       json_for_each_item sendopts_cb sendopts
+       json_for_each_item proto_dhcpv6_add_sendopts sendopts opts
 
        append opts "-t${soltimeout:-120}"