From dea8a6bc59bfce2dada71e48e03d692c65aaf6db Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 3 Jun 2019 16:15:19 +0200 Subject: [PATCH] Allow unix domains sockets for dnstap destinations --- pdns/pdns_recursor.cc | 9 ++++++++- pdns/rec-lua-conf.cc | 6 +++--- pdns/rec-lua-conf.hh | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index faa4d9bf76..491ae26bd9 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 bd077250cb..04e2d9f673 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}; -- 2.47.2