[openwrt/openwrt] odhcp6c: rework sendopts handling

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 24 12:04:22 PST 2018


dedeckeh pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/1a5863d6d70032b46dbc0e14ae1abb29ac3e81a8

commit 1a5863d6d70032b46dbc0e14ae1abb29ac3e81a8
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sat Feb 24 20:59:10 2018 +0100

    odhcp6c: rework sendopts handling
    
    Bring logic of sendopts handling in line with ip6prefix handling
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile        |  2 +-
 package/network/ipv6/odhcp6c/files/dhcpv6.sh | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 8abb633..3d6d944 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -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
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 54e5106..919872f 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -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}"
 



More information about the lede-commits mailing list