summaryrefslogtreecommitdiff
path: root/package/network/config/netifd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-04-05 18:17:22 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-04-05 18:17:22 +0000
commitdca014db767b214182755e6b35467a9b8ce05cca (patch)
tree2481fe36299f4646838b57e98fa54e974d4ae9a2 /package/network/config/netifd
parent0dd2d18400b14b441a01e38cac272a97dbba49f9 (diff)
downloadmtk-20170518-dca014db767b214182755e6b35467a9b8ce05cca.zip
mtk-20170518-dca014db767b214182755e6b35467a9b8ce05cca.tar.gz
mtk-20170518-dca014db767b214182755e6b35467a9b8ce05cca.tar.bz2
netifd: Add renew handler for proto dhcp
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> SVN-Revision: 40385
Diffstat (limited to 'package/network/config/netifd')
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh9
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 dc8c97c..2e58c19 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"