]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Address clang-tidy complains.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 25 Jul 2025 09:10:32 +0000 (11:10 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 25 Jul 2025 12:17:22 +0000 (14:17 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/misc.cc
pdns/resolver.cc
pdns/tcpreceiver.cc

index 5fa254c1c3a94943fe2cfd498bf866757dcfc11f..f8ccfa82dcbc8c53eec75196ff72c958147c2af8 100644 (file)
@@ -1375,20 +1375,27 @@ uint64_t getCPUSteal(const std::string& /* str */)
 
 bool getTSIGHashEnum(const DNSName& algoName, TSIGHashEnum& algoEnum)
 {
-  if (algoName == g_hmacmd5dnsname_long || algoName == g_hmacmd5dnsname)
+  if (algoName == g_hmacmd5dnsname_long || algoName == g_hmacmd5dnsname) {
     algoEnum = TSIG_MD5;
-  else if (algoName == g_hmacsha1dnsname)
+  }
+  else if (algoName == g_hmacsha1dnsname) {
     algoEnum = TSIG_SHA1;
-  else if (algoName == g_hmacsha224dnsname)
+  }
+  else if (algoName == g_hmacsha224dnsname) {
     algoEnum = TSIG_SHA224;
-  else if (algoName == g_hmacsha256dnsname)
+  }
+  else if (algoName == g_hmacsha256dnsname) {
     algoEnum = TSIG_SHA256;
-  else if (algoName == g_hmacsha384dnsname)
+  }
+  else if (algoName == g_hmacsha384dnsname) {
     algoEnum = TSIG_SHA384;
-  else if (algoName == g_hmacsha512dnsname)
+  }
+  else if (algoName == g_hmacsha512dnsname) {
     algoEnum = TSIG_SHA512;
-  else if (algoName == g_gsstsigdnsname)
+  }
+  else if (algoName == g_gsstsigdnsname) {
     algoEnum = TSIG_GSS;
+  }
   else {
      return false;
   }
index 3b51ff09e8e5fbbc2d2f4ff8d659b04737a182d9..7baede556a7deb318c20ea3e4a5fa5662a669887 100644 (file)
@@ -144,10 +144,12 @@ uint16_t Resolver::sendResolve(const ComboAddress& remote, const ComboAddress& l
   if(!tsigkeyname.empty()) {
     // cerr<<"Adding TSIG to notification, key name: '"<<tsigkeyname<<"', algo: '"<<tsigalgorithm<<"', secret: "<<Base64Encode(tsigsecret)<<endl;
     TSIGRecordContent trc;
-    if (tsigalgorithm == g_hmacmd5dnsname)
+    if (tsigalgorithm == g_hmacmd5dnsname) {
       trc.d_algoName = g_hmacmd5dnsname_long;
-    else
+    }
+    else {
       trc.d_algoName = tsigalgorithm;
+    }
     trc.d_time = time(nullptr);
     trc.d_fudge = 300;
     trc.d_origID=ntohs(randomid);
index ab18fff12d1cb2f0040421d9877369242c7894b7..600591a011135c67b1a6f5205787abfb36f68331 100644 (file)
@@ -683,8 +683,9 @@ int TCPNameserver::doAXFR(const ZoneName &targetZone, std::unique_ptr<DNSPacket>
   if(haveTSIGDetails && !tsigkeyname.empty()) {
     string tsig64;
     DNSName algorithm=trc.d_algoName;
-    if (algorithm == g_hmacmd5dnsname_long)
+    if (algorithm == g_hmacmd5dnsname_long) {
       algorithm = g_hmacmd5dnsname;
+    }
     if (algorithm != g_gsstsigdnsname) {
       if(!db.getTSIGKey(tsigkeyname, algorithm, tsig64)) {
         g_log<<Logger::Warning<<logPrefix<<"TSIG key not found"<<endl;
@@ -1289,8 +1290,9 @@ int TCPNameserver::doIXFR(std::unique_ptr<DNSPacket>& q, int outsock)
     if(haveTSIGDetails && !tsigkeyname.empty()) {
       string tsig64;
       DNSName algorithm=trc.d_algoName; // FIXME400: was toLowerCanonic, compare output
-      if (algorithm == g_hmacmd5dnsname_long)
+      if (algorithm == g_hmacmd5dnsname_long) {
         algorithm = g_hmacmd5dnsname;
+      }
       if (!db.getTSIGKey(tsigkeyname, algorithm, tsig64)) {
         g_log << Logger::Error << "TSIG key '" << tsigkeyname << "' for domain '" << target << "' not found" << endl;
         return 0;