netifd: Add renew handler for proto dhcp

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

SVN-Revision: 40385
This commit is contained in:
Felix Fietkau 2014-04-05 18:17:22 +00:00
parent 0dd2d18400
commit dca014db76

View file

@ -5,6 +5,8 @@
init_proto "$@"
proto_dhcp_init_config() {
renew_handler=1
proto_config_add_string 'ipaddr:ipaddr'
proto_config_add_string 'hostname:hostname'
proto_config_add_string clientid
@ -51,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"