summaryrefslogtreecommitdiff
path: root/package/network
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2013-10-17 12:55:40 +0000
committerSteven Barth <cyrus@openwrt.org>2013-10-17 12:55:40 +0000
commitc759b49a4ff8da29d40dd996528ed50807eda438 (patch)
tree1df12ac302f02f357845f8f256cf5918d3b95ae3 /package/network
parent5b1e1eff73164e67854be8b39bd9f61645430000 (diff)
downloadmtk-20170518-c759b49a4ff8da29d40dd996528ed50807eda438.zip
mtk-20170518-c759b49a4ff8da29d40dd996528ed50807eda438.tar.gz
mtk-20170518-c759b49a4ff8da29d40dd996528ed50807eda438.tar.bz2
Added 'customopts' dhcp protocol option, which is an array passed along to udhcpc as series of -x options.
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi> SVN-Revision: 38436
Diffstat (limited to 'package/network')
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh9
1 files changed, 7 insertions, 2 deletions
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 a270c68..1e0aa68 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -13,20 +13,25 @@ proto_dhcp_init_config() {
proto_config_add_boolean "broadcast"
proto_config_add_string "reqopts"
proto_config_add_string "iface6rd"
+ proto_config_add_string "customopts"
}
proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd customopts
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd customopts
local opt dhcpopts
for opt in $reqopts; do
append dhcpopts "-O $opt"
done
+ for opt in $customopts; do
+ append dhcpopts "-x $opt"
+ done
+
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"