aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-02-01 15:12:58 +0100
committerHans Dedecker <dedeckeh@gmail.com>2018-02-01 21:44:12 +0100
commit60e07ffec5d797ffae4417a8b8fc1854158e8faf (patch)
tree9e6029f66f8a8a50a61cf2c587f77e31efcf04df
parentcc7a005c1a8b050447a6c67c18a1681f25800b34 (diff)
downloadupstream-60e07ffec5d797ffae4417a8b8fc1854158e8faf.tar.gz
upstream-60e07ffec5d797ffae4417a8b8fc1854158e8faf.tar.bz2
upstream-60e07ffec5d797ffae4417a8b8fc1854158e8faf.zip
netifd: add defaultreqopts config option
By default udhcpc asks for a default list of options; the config option defaultreqopts allows to tweak this behavior. When set to 0 udhcpc will not ask for any options except for the options specified in the reqopts config option. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--package/network/config/netifd/Makefile2
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh8
2 files changed, 6 insertions, 4 deletions
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index bb9ba2fea1..efa74805a3 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 143e4451b6..385cfc3974 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -14,6 +14,7 @@ proto_dhcp_init_config() {
proto_config_add_boolean 'broadcast:bool'
proto_config_add_boolean 'release:bool'
proto_config_add_string 'reqopts:list(string)'
+ proto_config_add_boolean 'defaultreqopts:bool'
proto_config_add_string iface6rd
proto_config_add_string sendopts
proto_config_add_boolean delegate
@@ -28,8 +29,8 @@ proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
- json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
+ local ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
+ json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
local opt dhcpopts
for opt in $reqopts; do
@@ -41,6 +42,7 @@ proto_dhcp_setup() {
done
[ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)"
+ [ "$defaultreqopts" = 0 ] && defaultreqopts="-o" || defaultreqopts=
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
@@ -62,7 +64,7 @@ proto_dhcp_setup() {
${ipaddr:+-r $ipaddr} \
${hostname:+-x "hostname:$hostname"} \
${vendorid:+-V "$vendorid"} \
- $clientid $broadcast $release $dhcpopts
+ $clientid $defaultreqopts $broadcast $release $dhcpopts
}
proto_dhcp_renew() {