diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-05-24 09:12:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-05-24 09:12:50 +0000 |
commit | 71f990ccfb1ee6a9d1e8303019b5f8231d400871 (patch) | |
tree | 2308d97069c104c7113c879bb44122f42100da2c /package/dnsmasq | |
parent | 55283cbc90896ca72485ce1f754d101f93bde117 (diff) | |
download | upstream-71f990ccfb1ee6a9d1e8303019b5f8231d400871.tar.gz upstream-71f990ccfb1ee6a9d1e8303019b5f8231d400871.tar.bz2 upstream-71f990ccfb1ee6a9d1e8303019b5f8231d400871.zip |
[PATCH] dnsmasq: allow hostname assignment without static lease
The attached patch for dnsmasq.init allows to assign a hostname to a
particular mac-address. It's useful to override the client supplied
hostname, especially if the client does not supply a hostname at all.
It corresponds to the following example in dnsmasq.conf.example:
# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred
Regards
Mathias
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26983 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/dnsmasq')
-rw-r--r-- | package/dnsmasq/Makefile | 2 | ||||
-rw-r--r-- | package/dnsmasq/files/dnsmasq.init | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/package/dnsmasq/Makefile b/package/dnsmasq/Makefile index b71db58587..accce6e40e 100644 --- a/package/dnsmasq/Makefile +++ b/package/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.57 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index cd5a78ae83..a0e893c5fd 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -206,20 +206,19 @@ dhcp_vendorclass_add() { dhcp_host_add() { local cfg="$1" - config_get name "$cfg" name - config_get networkid "$cfg" networkid [ -n "$networkid" ] && dhcp_option_add "$cfg" "$networkid" + config_get name "$cfg" name config_get ip "$cfg" ip - [ -n "$ip" ] || return 0 + [ -n "$ip" ] || [ -n "$name" ] || return 0 macs="" config_get mac "$cfg" mac for m in $mac; do append macs "$m" ","; done [ -n "$macs" ] || return 0 - append args "--dhcp-host=$macs,${networkid:+net:$networkid,}$ip${name:+,$name}" + append args "--dhcp-host=$macs${networkid:+,net:$networkid}${ip:+,$ip}${name:+,$name}" } dhcp_mac_add() { |