diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2022-02-08 12:46:55 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2022-02-28 12:00:28 +0100 |
commit | 73f6ce7d6eca51f0e8f62717e18e764787ab6528 (patch) | |
tree | 1ded49975d2a2aa0c9665a1b3be94b8f1f95464b /modules | |
parent | Merge !1257: lib/resolve, modules: NO_ANSWER for not responding to clients (diff) | |
download | knot-resolver-73f6ce7d6eca51f0e8f62717e18e764787ab6528.tar.xz knot-resolver-73f6ce7d6eca51f0e8f62717e18e764787ab6528.zip |
modules/dnstap: don't do anything on loading the module
Usually in configuration the module is loaded in a separate command
from passing configuration to it. For dnstap this loading would
immediately lead to opening the default socket path, even if the
configuration actually specifies (a different) path later.
Users can still force using the default by passing an empty table:
`dnstap.config({})` or `modules = { dnstap = {}}`
(though I doubt the utility of the default /tmp/dnstap.sock anyway)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/dnstap/dnstap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/dnstap/dnstap.c b/modules/dnstap/dnstap.c index f8b471fc..a137dadb 100644 --- a/modules/dnstap/dnstap.c +++ b/modules/dnstap/dnstap.c @@ -404,11 +404,12 @@ static bool find_bool(const JsonNode *node) { KR_EXPORT int dnstap_config(struct kr_module *module, const char *conf) { dnstap_clear(module); + if (!conf) return kr_ok(); /* loaded module without configuring */ struct dnstap_data *data = module->data; auto_free char *sock_path = NULL; /* Empty conf passed, set default */ - if (!conf || strlen(conf) < 1) { + if (strlen(conf) < 1) { sock_path = strdup(DEFAULT_SOCK_PATH); } else { |