]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix formatting
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 5 Dec 2025 15:26:02 +0000 (16:26 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jan 2026 09:49:36 +0000 (10:49 +0100)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/dnsdist-configuration-yaml.cc
pdns/dnsdistdist/dnsdist.cc
pdns/logging.hh

index 2cc410adc5bcd57320d44a64a9fa4e62aac4cdeb..78294da02053f08f8d1967ab5680f1f55b03db0e 100644 (file)
@@ -970,7 +970,6 @@ static void handleLoggingConfiguration(const dnsdist::rust::settings::LoggingCon
     config.d_loggingBackend = std::string(settings.structured.backend);
     config.d_structuredLogging = settings.structured.enabled;
   });
-
 }
 
 static void handleConsoleConfiguration(const dnsdist::rust::settings::ConsoleConfiguration& consoleConf)
index a78fd3eb36690c5defa6156e04c760b48ae74948..9f6c37e1c1fa183b43df379e6db35d346846b135 100644 (file)
@@ -1120,7 +1120,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       case DNSAction::Action::Truncate:
         if (!dnsQuestion.overTCP()) {
           VERBOSESLOG(infolog("Query from %s truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                     dnsQuestion.getLogger()->info("Query truncated because of a dynamic rule"));
+                      dnsQuestion.getLogger()->info("Query truncated because of a dynamic rule"));
           updateBlockStats();
           dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
             header.tc = true;
@@ -1201,7 +1201,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       case DNSAction::Action::Truncate:
         if (!dnsQuestion.overTCP()) {
           VERBOSESLOG(infolog("Query from %s truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                     dnsQuestion.getLogger()->info("Query truncated because of a suffix-based dynamic rule"));
+                      dnsQuestion.getLogger()->info("Query truncated because of a suffix-based dynamic rule"));
           updateBlockStats();
           dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
             header.tc = true;
@@ -1310,7 +1310,7 @@ static bool isUDPQueryAcceptable(ClientState& clientState, const struct msghdr*
   expectProxyProtocol = clientState.d_enableProxyProtocol && expectProxyProtocolFrom(remote);
   if (!dnsdist::configuration::getCurrentRuntimeConfiguration().d_ACL.match(remote) && !expectProxyProtocol) {
     VERBOSESLOG(infolog("Query from %s dropped because of ACL", remote.toStringWithPort()),
-               dnsdist::logging::getTopLogger()->info("Query dropped because of ACL", "address", Logging::Loggable(dest)));
+                dnsdist::logging::getTopLogger()->info("Query dropped because of ACL", "address", Logging::Loggable(dest)));
     ++dnsdist::metrics::g_stats.aclDrops;
     return false;
   }
index e8073388f148e508c09aad755f4ca43cc3e4ca5a..bb874dafce28b14b19ffb8dc23a59c895175fe21 100644 (file)
@@ -230,16 +230,15 @@ constexpr bool g_slogStructured = true;
 
 #else // DNSdist
 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
-#define SLOG(nonStructured, structured)             \
-  do {                                              \
-    if (dnsdist::logging::doStructuredLogging()) {  \
-      structured;                                   \
-    }                                               \
-    else {                                          \
-      nonStructured;                                \
-    }                                               \
-  }                                                 \
-  while (0)
+#define SLOG(nonStructured, structured)            \
+  do {                                             \
+    if (dnsdist::logging::doStructuredLogging()) { \
+      structured;                                  \
+    }                                              \
+    else {                                         \
+      nonStructured;                               \
+    }                                              \
+  } while (0)
 
 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
 #define VERBOSESLOG(nonStructured, structured)  \
@@ -247,8 +246,7 @@ constexpr bool g_slogStructured = true;
     if (dnsdist::logging::doVerboseLogging()) { \
       SLOG(nonStructured, structured);          \
     }                                           \
-  }                                             \
-  while (0)
+  } while (0)
 
 #endif /* ! DNSDIST */