From ddaa3d81f23f9aa4a7a5da5763d63fe407fb04a2 Mon Sep 17 00:00:00 2001 From: jow Date: Fri, 2 Apr 2010 22:56:22 +0000 Subject: [package] dnsmasq: allow multiple hostnames per domain section git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20656 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/dnsmasq/Makefile | 2 +- package/dnsmasq/files/dnsmasq.init | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package/dnsmasq/Makefile b/package/dnsmasq/Makefile index 098728e7b..895a5c295 100644 --- a/package/dnsmasq/Makefile +++ b/package/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.52 -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 1b6dee426..4cd941cfd 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -284,16 +284,22 @@ dhcp_option_add() { dhcp_domain_add() { local cfg="$1" + local ip name names - config_get name "$cfg" name - [ -n "$name" ] || return 0 + config_get names "$cfg" name + [ -n "$names" ] || return 0 config_get ip "$cfg" ip [ -n "$ip" ] || return 0 local oIFS="$IFS"; IFS="."; set -- $ip; IFS="$oIFS" - append args "-A /$name${DOMAIN:+.$DOMAIN}/$ip" - append args "--ptr-record=$4.$3.$2.$1.in-addr.arpa,$name${DOMAIN:+.$DOMAIN}" + local raddr="${4:+$4.$3.$2.$1.in-addr.arpa}" + + for name in $names; do + append args "-A /$name${DOMAIN:+.$DOMAIN}/$ip" + [ -n "$raddr" ] && \ + append args "--ptr-record=$raddr,$name${DOMAIN:+.$DOMAIN}" + done } start() { -- cgit v1.2.3