From: Otto Moerbeek Date: Mon, 3 Jun 2019 14:15:19 +0000 (+0200) Subject: Allow unix domains sockets for dnstap destinations X-Git-Tag: dnsdist-1.4.0-beta1~1^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dea8a6bc59bfce2dada71e48e03d692c65aaf6db;p=pdns Allow unix domains sockets for dnstap destinations --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index faa4d9bf7..491ae26bd 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -983,7 +983,14 @@ static std::shared_ptr>> startFra options["outputQueueSize"] = config.outputQueueSize; options["queueNotifyThreshold"] = config.queueNotifyThreshold; options["reopenInterval"] = config.reopenInterval; - auto fsl = new FrameStreamLogger(server.sin4.sin_family, server.toStringWithPort(), true, options); + FrameStreamLogger *fsl = nullptr; + try { + ComboAddress address(server); + fsl = new FrameStreamLogger(address.sin4.sin_family, address.toStringWithPort(), true, options); + } + catch (const PDNSException& e) { + fsl = new FrameStreamLogger(AF_UNIX, server, true, options); + } fsl->setLogQueries(config.logQueries); fsl->setLogResponses(config.logResponses); result->emplace_back(fsl); diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index bd077250c..04e2d9f67 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -554,14 +554,14 @@ void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& de parseFrameStreamOptions(vars, lci.frameStreamExportConfig); } catch(std::exception& e) { - g_log< servers; + std::vector servers; bool enabled{false}; bool logQueries{true}; bool logResponses{true};