Skip to content
Snippets Groups Projects
Verified Commit 73f6ce7d authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

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)
parent b4cc3a40
Branches
Tags
1 merge request!1256modules/dnstap: improve UX for common errors
......@@ -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 {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment