]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Apply Charles-Henri's suggestions (thanks!) 11652/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 30 Jan 2024 09:58:21 +0000 (10:58 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 30 Jan 2024 09:58:21 +0000 (10:58 +0100)
pdns/dnsdist-lua-bindings.cc
pdns/xsk.hh

index 12bf6652683374e709d1a80d3c4b01f6cb7c3139..69638e23ec3a22ba54b92395748003498b26fca5 100644 (file)
@@ -752,10 +752,9 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck)
     dnsdist::xsk::g_xsk.push_back(socket);
     return socket;
   });
-  luaCtx.registerFunction<std::string(std::shared_ptr<XskSocket>::*)()const>("getMetrics", [](const std::shared_ptr<XskSocket>& xsk) {
-    std::string result;
+  luaCtx.registerFunction<std::string(std::shared_ptr<XskSocket>::*)()const>("getMetrics", [](const std::shared_ptr<XskSocket>& xsk) -> std::string {
     if (!xsk) {
-      return result;
+      return {};
     }
     return xsk->getMetrics();
   });
index 53b884155a97e387d7b2cbad54b3fb8705c061b8..e181e63823827e14e9c922099a579e660c805721 100644 (file)
 #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<uint8_t, 6>;
 
-using XskPacketPtr = std::unique_ptr<XskPacket>;
-
 // 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.