From feb2beadec0d539fdd310a3daa54a91e7d3a48db Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 30 Jan 2024 10:58:21 +0100 Subject: [PATCH] dnsdist: Apply Charles-Henri's suggestions (thanks!) --- pdns/dnsdist-lua-bindings.cc | 5 ++--- pdns/xsk.hh | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index 12bf665268..69638e23ec 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -752,10 +752,9 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck) dnsdist::xsk::g_xsk.push_back(socket); return socket; }); - luaCtx.registerFunction::*)()const>("getMetrics", [](const std::shared_ptr& xsk) { - std::string result; + luaCtx.registerFunction::*)()const>("getMetrics", [](const std::shared_ptr& xsk) -> std::string { if (!xsk) { - return result; + return {}; } return xsk->getMetrics(); }); diff --git a/pdns/xsk.hh b/pdns/xsk.hh index 53b884155a..e181e63823 100644 --- a/pdns/xsk.hh +++ b/pdns/xsk.hh @@ -49,17 +49,13 @@ #include "lock.hh" #include "misc.hh" #include "noinitvector.hh" -#endif /* HAVE_XSK */ class XskPacket; class XskWorker; class XskSocket; -#ifdef HAVE_XSK using MACAddr = std::array; -using XskPacketPtr = std::unique_ptr; - // We use an XskSocket to manage an AF_XDP Socket corresponding to a NIC queue. // The XDP program running in the kernel redirects the data to the XskSocket in userspace. // We allocate frames that are placed into the descriptors in the fill queue, allowing the kernel to put incoming packets into the frames and place descriptors into the rx queue. -- 2.47.2