X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=package%2Fnetwork%2Fconfig%2Fnetifd%2Ffiles%2Flib%2Fnetifd%2Fproto%2Fdhcp.sh;h=2e58c19c44ec1af7b0270d459564d5f7d05046d3;hb=dca014db767b214182755e6b35467a9b8ce05cca;hp=80c3562e69a36e380738ab6af68f53411fe86867;hpb=2a893c205727686089887358498248ea21a91106;p=openwrt%2Fopenwrt.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 80c3562e69..2e58c19c44 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -5,24 +5,26 @@ init_proto "$@" proto_dhcp_init_config() { + renew_handler=1 + proto_config_add_string 'ipaddr:ipaddr' - proto_config_add_string 'netmask:ipaddr' proto_config_add_string 'hostname:hostname' proto_config_add_string clientid proto_config_add_string vendorid - proto_config_add_boolean 'broadcast:ipaddr' + proto_config_add_boolean 'broadcast:bool' proto_config_add_string 'reqopts:list(string)' proto_config_add_string iface6rd proto_config_add_string sendopts proto_config_add_boolean delegate + proto_config_add_string zone6rd } proto_dhcp_setup() { local config="$1" local iface="$2" - local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate - json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate + local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd + json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd local opt dhcpopts for opt in $reqopts; do @@ -37,6 +39,7 @@ proto_dhcp_setup() { [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C" [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd" [ -n "$iface6rd" ] && append dhcpopts "-O 212" + [ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd" [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0" proto_export "INTERFACE=$config" @@ -50,6 +53,13 @@ proto_dhcp_setup() { $clientid $broadcast $dhcpopts } +proto_dhcp_renew() { + local interface="$1" + # SIGUSR1 forces udhcpc to renew its lease + local sigusr1="$(kill -l SIGUSR1)" + [ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1 +} + proto_dhcp_teardown() { local interface="$1" proto_kill_command "$interface"