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
This commit is contained in:
parent
5b1e1eff73
commit
c759b49a4f
1 changed files with 7 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue