diff options
author | John Crispin <john@openwrt.org> | 2016-02-26 09:13:03 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2016-02-26 09:13:03 +0000 |
commit | b5bfb3534b693f7781978b369d4f1bb2995bfcd4 (patch) | |
tree | b1539e3ee34f577164c355a04dc7e50eaed01ad1 /package/network/services/dnsmasq/files | |
parent | c503984876e223801e7882e8499718f860f574ea (diff) | |
download | upstream-b5bfb3534b693f7781978b369d4f1bb2995bfcd4.tar.gz upstream-b5bfb3534b693f7781978b369d4f1bb2995bfcd4.tar.bz2 upstream-b5bfb3534b693f7781978b369d4f1bb2995bfcd4.zip |
dnsmasq: add host-specific lease time option for static hosts
Enable setting a host-specific lease time for static hosts.
The new option is called "leasetime" and the format is similar
as for the default lease time: e.g. 12h, 3d, infinite
Default lease time is used for all hosts for which there is
no host-specific definition.
The option is added to /etc/config/dhcp for the selected hosts:
config host
option name 'Nexus'
option mac 'd8:50:66:55:59:7c'
option ip '192.168.1.245'
option leasetime '2h'
It gets appended to /var/etc/dnsmasq.conf like this:
dhcp-host=d8:50:66:55:59:7c,192.168.1.245,Nexus,2h
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
SVN-Revision: 48801
Diffstat (limited to 'package/network/services/dnsmasq/files')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 0904503fac..61ded6a53a 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -342,7 +342,9 @@ dhcp_host_add() { config_get_bool broadcast "$cfg" broadcast 0 [ "$broadcast" = "0" ] && broadcast= - xappend "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}" + config_get leasetime "$cfg" leasetime + + xappend "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}${leasetime:+,$leasetime}" } dhcp_tag_add() { |