Software /
code /
prosody
Comparison
net/unbound.lua @ 12509:a92e1de62c9e 0.12
net.unbound: Disable use of hosts file by default (fixes #1737)
This mirrors the behaviour with net.dns and avoids the initialization
issue in #1737
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 16 May 2022 12:45:51 +0200 |
parent | 12110:b5b799a2a10c |
child | 12510:cd3b5912c9a3 |
comparison
equal
deleted
inserted
replaced
12507:e242a6e74424 | 12509:a92e1de62c9e |
---|---|
23 local gettime = require"socket".gettime; | 23 local gettime = require"socket".gettime; |
24 local dns_utils = require"util.dns"; | 24 local dns_utils = require"util.dns"; |
25 local classes, types, errors = dns_utils.classes, dns_utils.types, dns_utils.errors; | 25 local classes, types, errors = dns_utils.classes, dns_utils.types, dns_utils.errors; |
26 local parsers = dns_utils.parsers; | 26 local parsers = dns_utils.parsers; |
27 | 27 |
28 local builtin_defaults = { hoststxt = false } | |
29 | |
28 local function add_defaults(conf) | 30 local function add_defaults(conf) |
29 if conf then | 31 if conf then |
32 for option, default in pairs(builtin_defaults) do | |
33 if conf[option] == nil then | |
34 conf[option] = default; | |
35 end | |
36 end | |
30 for option, default in pairs(libunbound.config) do | 37 for option, default in pairs(libunbound.config) do |
31 if conf[option] == nil then | 38 if conf[option] == nil then |
32 conf[option] = default; | 39 conf[option] = default; |
33 end | 40 end |
34 end | 41 end |
42 else | |
43 return builtin_defaults; | |
35 end | 44 end |
36 return conf; | 45 return conf; |
37 end | 46 end |
38 | 47 |
39 local unbound_config; | 48 local unbound_config; |