unbound: add option for dhcp UCI domain mx srv and cname

Base LEDE/OpenWrt UCI for dnsmasq provides for DNS override in
/etc/config/dhcp. It is desired to be able to use dnsmasq and
Unbound as transparently as possible. Option 'add_extra_dns'
will pull 'domain', 'mxhost', 'srvhost, and 'cname' from base.

netifd/procd have an interaction with DHCPv6/RA on WAN (FS#713).
Minor IP6 parameter updates can cause Unbound reload events every
few minutes. List option 'trigger' selects which interfaces may
cause reload. For example 'lan', 'wan' but not 'wan6'.

Squash other cosmetics.

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
This commit is contained in:
Eric Luehrsen
2017-05-09 22:46:39 -04:00
parent 2814a950f5
commit 9d96dfd468
6 changed files with 215 additions and 23 deletions
+14 -3
View File
@@ -47,7 +47,7 @@ start_service() {
stop_service() {
unbound_stop
# Wait! on restart Unbound may take time writing closure stats to syslog
pidof $PROG && sleep 1
}
@@ -55,9 +55,20 @@ stop_service() {
##############################################################################
service_triggers() {
# use soft reload to prevent continuous stop-start and cache flush
local trigger
local triggers=$( uci_get unbound.@unbound[0].trigger )
PROCD_RELOAD_DELAY=2000
procd_add_reload_trigger "unbound"
procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
if [ -n "$triggers" ] ; then
for trigger in $triggers ; do
# due to some netifd/procd interactions with IP6, limit interfaces
procd_add_reload_interface_trigger "$trigger"
done
else
procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
fi
}
##############################################################################