From dca014db767b214182755e6b35467a9b8ce05cca Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 5 Apr 2014 18:17:22 +0000 Subject: [PATCH] netifd: Add renew handler for proto dhcp Signed-off-by: Helmut Schaa SVN-Revision: 40385 --- .../network/config/netifd/files/lib/netifd/proto/dhcp.sh | 9 +++++++++ 1 file changed, 9 insertions(+) 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 dc8c97c8fe..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,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" -- 2.25.1