[package] dnsmasq:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 23 Apr 2010 13:40:50 +0000 (13:40 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 23 Apr 2010 13:40:50 +0000 (13:40 +0000)
- when processing domain entries, append searchdomain to host entries if they are not fully qualified
- create only one reverse record for address entries with multiple names

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21109 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/dnsmasq/Makefile
package/dnsmasq/files/dnsmasq.init

index abf0962..77b8f82 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.52
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 47c4c2d..15f856d 100644 (file)
@@ -296,9 +296,17 @@ dhcp_domain_add() {
        local raddr="${4:+$4.$3.$2.$1.in-addr.arpa}"
 
        for name in $names; do
-               append args "-A /$name/$ip"
-               [ -n "$raddr" ] && \
-                       append args "--ptr-record=$raddr,$name"
+               local fqdn="$name"
+
+               [ "${fqdn%.*}" == "$fqdn" ] && \
+                       fqdn="$fqdn${DOMAIN:+.$DOMAIN}"
+
+               append args "-A /$fqdn/$ip"
+               
+               [ -n "$raddr" ] && {
+                       append args "--ptr-record=$raddr,$fqdn"
+                       raddr=""
+               }
        done
 }