summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-11-04 22:40:56 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-11-04 22:40:56 +0000
commit22d9ba994469e70ae7673dda9cc65643ccf8a5d8 (patch)
tree1716c15a4af39e777505184afc85ec6a0b05ddbf /package
parent85e6b8a39df7653e28bc7a69d30dd2d17ef295b5 (diff)
dnsmasq: fix backward compatibility with existing configs
Changeset r36943 ("dnsmasq: use host-record instead of address") removed the automatic domain expansion for config domain sections, this breaks existing setups and alters the old behaviour in unexpected ways, therfore restore behaviour of the current stable release. Additionally handle fully qualified hostnames properly when setting up the own hostrecord by stripping the local domain part form the given name instead of unconditionally appending it, so that "example.lan" results in "example example.lan" and not "example.lan example.lan.lan". git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38648 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init5
2 files changed, 5 insertions, 2 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index ae3662b3f5..02712bdc7d 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_VERSION:=2.66
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 561f89d33d..ca3bb5248e 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -408,6 +408,9 @@ dhcp_domain_add() {
[ -n "$ip" ] || return 0
for name in $names; do
+ [ "${name%.*}" == "$name" ] && \
+ name="$name${DOMAIN:+.$DOMAIN}"
+
record="${record:+$record/}$name"
done
@@ -531,7 +534,7 @@ start_service() {
# add own hostname
[ $ADD_LOCAL_HOSTNAME -eq 1 ] && [ -n "$lanaddr" ] && {
local hostname="$(uci_get system @system[0] hostname OpenWrt)"
- dhcp_hostrecord_add "" "$hostname${DOMAIN:+.$DOMAIN $hostname}" "$lanaddr"
+ dhcp_hostrecord_add "" "${hostname%.$DOMAIN}${DOMAIN:+.$DOMAIN ${hostname%.$DOMAIN}}" "$lanaddr"
}
echo >> $CONFIGFILE