dnsmasq: allow dhcp host entries without mac addresses (#11928)
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 2 Jan 2013 15:14:19 +0000 (15:14 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 2 Jan 2013 15:14:19 +0000 (15:14 +0000)
SVN-Revision: 34971

package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.init

index d92b00f9981cbb090db034f3137e9ca561c55757..26670e5d5386916aae54dd1cd9550828930ca319 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.62
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 85c22c37451bd8a31f95871669ad023fe6ea734f..f2e111bed578cba0df6f612aaa7a832acdce0bf9 100644 (file)
@@ -253,10 +253,15 @@ dhcp_host_add() {
        config_get ip "$cfg" ip
        [ -n "$ip" -o -n "$name" ] || return 0
 
-       macs=""
        config_get mac "$cfg" mac
+       [ -z "$mac" ] && {
+               [ -n "$name" ] || return 0
+               mac="$name"
+               name=""
+       }
+
+       macs=""
        for m in $mac; do append macs "$m" ","; done
-       [ -n "$macs" ] || return 0
 
        config_get tag "$cfg" tag