diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-04-05 18:17:22 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-04-05 18:17:22 +0000 |
commit | 8edf724ac677ee4e022a34dd33b4ceb55c016493 (patch) | |
tree | c197416b86adbe4250cd55e940410be3fcedabeb /package | |
parent | 375eb86ab864230997ce463987db2d205538b6f8 (diff) | |
download | upstream-8edf724ac677ee4e022a34dd33b4ceb55c016493.tar.gz upstream-8edf724ac677ee4e022a34dd33b4ceb55c016493.tar.bz2 upstream-8edf724ac677ee4e022a34dd33b4ceb55c016493.zip |
netifd: Add renew handler for proto dhcp
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40385 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-x | package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 9 |
1 files changed, 9 insertions, 0 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 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" |