diff options
author | John Crispin <blogic@openwrt.org> | 2014-09-01 13:22:05 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-09-01 13:22:05 +0000 |
commit | e92a953a03702ab2f71ed6fc9477f3971f7afda7 (patch) | |
tree | fc19048aff1e608b46b4d7159f4c0f69b6c13cb2 /package/network | |
parent | fb523872e123a6e70a1c3cd6023e70aa61ecc4c6 (diff) | |
download | upstream-e92a953a03702ab2f71ed6fc9477f3971f7afda7.tar.gz upstream-e92a953a03702ab2f71ed6fc9477f3971f7afda7.tar.bz2 upstream-e92a953a03702ab2f71ed6fc9477f3971f7afda7.zip |
dnsmasq: Create rDNS records for LuCI "Hostnames"
LuCI creates "domain" UCI config sections, which the dnsmasq init file
then, currently, translates into "address" config lines. This is not
the correct usage of "address" (see r36943), and also causes rDNS
records to not be created. This patches dnsmasq.init to utilize the
additional hosts file introduced in r40799 for such domain names,
resolving both issues.
Signed-off-by: Tyler Fenby <tylerf@securecominc.com>
Backport of r42318
git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@42388 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 2ea73af947..c2704e4b9a 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -441,13 +441,10 @@ dhcp_domain_add() { [ -n "$ip" ] || return 0 for name in $names; do - [ "${name%.*}" == "$name" ] && \ - name="$name${DOMAIN:+.$DOMAIN}" - - record="${record:+$record/}$name" + record="${record:+$record }$name" done - xappend "--address=/$record/$ip" + echo "$ip $record" >> $HOSTFILE } dhcp_srv_add() { @@ -572,7 +569,7 @@ start_service() { local lanaddr [ $ADD_LOCAL_HOSTNAME -eq 1 ] && network_get_ipaddr lanaddr "lan" && { local hostname="$(uci_get system @system[0] hostname OpenWrt)" - dhcp_hostrecord_add "" "${hostname%.$DOMAIN}${DOMAIN:+.$DOMAIN ${hostname%.$DOMAIN}}" "$lanaddr" + dhcp_domain_add "" "$hostname" "$lanaddr" } echo >> $CONFIGFILE |