aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2016-05-10 22:36:36 +0000
committerLuka Perkov <luka@openwrt.org>2016-06-19 19:29:01 +0200
commit6ef5c78c0f9bb00a8e1b8da37742644d9ca0f04a (patch)
tree99dd788a51fd3eb894f9b42fc2075f8eb73d2de7 /package/network
parentff4f769d2087c957492918ac8f8d1bdacab70b1d (diff)
downloadmaster-187ad058-6ef5c78c0f9bb00a8e1b8da37742644d9ca0f04a.tar.gz
master-187ad058-6ef5c78c0f9bb00a8e1b8da37742644d9ca0f04a.tar.bz2
master-187ad058-6ef5c78c0f9bb00a8e1b8da37742644d9ca0f04a.zip
netifd: Add configurable DHCP release behavior
Make sending a DHCP release configurable when the client exits allowing to clean up IP/mac state info in intermediate devices. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49332 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh8
1 files changed, 5 insertions, 3 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 546e1d661a..7f4af25329 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -12,6 +12,7 @@ proto_dhcp_init_config() {
proto_config_add_string clientid
proto_config_add_string vendorid
proto_config_add_boolean 'broadcast:bool'
+ proto_config_add_boolean 'release:bool'
proto_config_add_string 'reqopts:list(string)'
proto_config_add_string iface6rd
proto_config_add_string sendopts
@@ -26,8 +27,8 @@ proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
+ local ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
+ json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
local opt dhcpopts
for opt in $reqopts; do
@@ -39,6 +40,7 @@ proto_dhcp_setup() {
done
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
+ [ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
@@ -56,7 +58,7 @@ proto_dhcp_setup() {
${ipaddr:+-r $ipaddr} \
${hostname:+-H $hostname} \
${vendorid:+-V $vendorid} \
- $clientid $broadcast $dhcpopts
+ $clientid $broadcast $release $dhcpopts
}
proto_dhcp_renew() {