From cf0edeb3d17171c662c0de06a9eb1ddea4597150 Mon Sep 17 00:00:00 2001 From: jow Date: Wed, 2 Jan 2013 15:14:19 +0000 Subject: dnsmasq: allow dhcp host entries without mac addresses (#11928) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34971 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/network/services/dnsmasq/files/dnsmasq.init | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'package/network/services/dnsmasq/files') diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 85c22c374..f2e111bed 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -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 -- cgit v1.2.3