From: Remi Gacogne Date: Tue, 30 Jan 2024 09:58:21 +0000 (+0100) Subject: dnsdist: Apply Charles-Henri's suggestions (thanks!) X-Git-Tag: dnsdist-1.9.0-rc1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11652%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Apply Charles-Henri's suggestions (thanks!) --- 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.