summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2016-01-12 10:03:50 +0000
committerJo-Philipp Wich <jow@openwrt.org>2016-01-12 10:03:50 +0000
commit722badfa82a2696705c9f2e7cbdaab0f71aa537f (patch)
tree94b7a1c44866e3132c377a81b4672deef2d85790
parent2224dbdb9de293497f8e6a56b5a587b54c8d9d97 (diff)
downloadmtk-20170518-722badfa82a2696705c9f2e7cbdaab0f71aa537f.zip
mtk-20170518-722badfa82a2696705c9f2e7cbdaab0f71aa537f.tar.gz
mtk-20170518-722badfa82a2696705c9f2e7cbdaab0f71aa537f.tar.bz2
dnsmasq: add local hostname record for own lan ula address as well
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48214
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init20
2 files changed, 18 insertions, 4 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index cddde5c..d4a6f1f 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.75
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
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 3ef2b3d..0cec6d8 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -599,10 +599,24 @@ start_service() {
config_foreach dhcp_hostrecord_add hostrecord
# add own hostname
- local lanaddr
- [ $ADD_LOCAL_HOSTNAME -eq 1 ] && network_get_ipaddr lanaddr "lan" && {
+ [ $ADD_LOCAL_HOSTNAME -eq 1 ] && {
+ local lanaddr lanaddr6
+ local ulaprefix="$(uci_get network @globals[0] ula_prefix)"
local hostname="$(uci_get system @system[0] hostname OpenWrt)"
- dhcp_domain_add "" "$hostname" "$lanaddr"
+
+ network_get_ipaddr lanaddr "lan" && {
+ dhcp_domain_add "" "$hostname" "$lanaddr"
+ }
+
+ network_get_ipaddrs6 lanaddr6 "lan" && {
+ for lanaddr6 in $lanaddr6; do
+ case "$lanaddr6" in
+ "${ulaprefix%%:/*}"*)
+ dhcp_domain_add "" "$hostname" "${ulaprefix%%/*}1"
+ ;;
+ esac
+ done
+ }
}
echo >> $CONFIGFILE