diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2016-01-12 10:03:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2016-01-12 10:03:50 +0000 |
commit | c9a4b8113c025a63c18886537d9d6bfb372c73a2 (patch) | |
tree | 57aafc6e11c14fa2cf11f81231bba8c9efd259f7 /package/network/services | |
parent | 59c6e6e2a1fed3d1782ae236ff0f2447d2b3d1be (diff) | |
download | master-187ad058-c9a4b8113c025a63c18886537d9d6bfb372c73a2.tar.gz master-187ad058-c9a4b8113c025a63c18886537d9d6bfb372c73a2.tar.bz2 master-187ad058-c9a4b8113c025a63c18886537d9d6bfb372c73a2.zip |
dnsmasq: add local hostname record for own lan ula address as well
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48214 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rw-r--r-- | package/network/services/dnsmasq/Makefile | 2 | ||||
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index cddde5c0a2..d4a6f1f672 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 3ef2b3d64c..0cec6d8924 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 |