[openwrt/openwrt] odhcp6c: add defaultreqopts config option

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 1 06:21:42 PST 2018


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

commit cc7a005c1a8b050447a6c67c18a1681f25800b34
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Wed Jan 31 12:58:53 2018 +0100

    odhcp6c: add defaultreqopts config option
    
    By default odhcp6c asks for a default list of options; the config option
    defaultreqopts allows to tweak this behavior.
    When set to 0 odhcp6c will not ask for any options except for the options
    specified in the reqopts config option.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile        | 2 +-
 package/network/ipv6/odhcp6c/files/dhcpv6.sh | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 891e8d9..674d12f 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:=5
+PKG_RELEASE:=6
 
 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 fa3c44c..82b329d 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -11,6 +11,7 @@ proto_dhcpv6_init_config() {
 	proto_config_add_string 'reqprefix:or("auto","no",range(0, 64))'
 	proto_config_add_string clientid
 	proto_config_add_string 'reqopts:list(uinteger)'
+	proto_config_add_string 'defaultreqopts:bool'
 	proto_config_add_string 'noslaaconly:bool'
 	proto_config_add_string 'forceprefix:bool'
 	proto_config_add_string 'extendprefix:bool'
@@ -39,8 +40,8 @@ proto_dhcpv6_setup() {
 	local config="$1"
 	local iface="$2"
 
-	local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
-	json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
+	local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
+	json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff
 
 
 	# Configure
@@ -52,6 +53,8 @@ proto_dhcpv6_setup() {
 
 	[ -n "$clientid" ] && append opts "-c$clientid"
 
+	[ "$defaultreqopts" = "0" ] && append opts "-R"
+
 	[ "$noslaaconly" = "1" ] && append opts "-S"
 
 	[ "$forceprefix" = "1" ] && append opts "-F"



More information about the lede-commits mailing list