From: Miod Vallat Date: Mon, 20 Oct 2025 15:33:35 +0000 (+0200) Subject: More Clang-Tidyze™ X-Git-Tag: rec-5.4.0-alpha1~162^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40eb9d465731229a4a439f1a5c85415648f1c75f;p=thirdparty%2Fpdns.git More Clang-Tidyze™ Signed-off-by: Miod Vallat --- diff --git a/pdns/packethandler.hh b/pdns/packethandler.hh index 4e5456cce2..e1ba41e7c5 100644 --- a/pdns/packethandler.hh +++ b/pdns/packethandler.hh @@ -92,8 +92,6 @@ private: void emitNSEC3(DNSPacket& p, std::unique_ptr& r, const NSEC3PARAMRecordContent &ns3prc, const DNSName& name, const string& namehash, const string& nexthash, int mode); int processUpdate(DNSPacket& p); int forwardPacket(const string &msgPrefix, const DNSPacket& p, const DomainInfo& di); - int checkUpdatePrescan(const DNSRecord *rr); - int checkUpdatePrerequisites(const DNSRecord *rr, DomainInfo *di); void makeNXDomain(DNSPacket& p, std::unique_ptr& r, const DNSName& target, const DNSName& wildcard); void makeNOError(DNSPacket& p, std::unique_ptr& r, const DNSName& target, const DNSName& wildcard, int mode); diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index fd280ab314..233b84bf23 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -25,21 +25,21 @@ std::mutex PacketHandler::s_rfc2136lock; // Context data for RFC2136 operation struct updateContext { - const DomainInfo *di; - bool isPresigned; + const DomainInfo *di{nullptr}; + bool isPresigned{false}; // The following may be modified - bool narrow; - bool haveNSEC3; - NSEC3PARAMRecordContent ns3pr; - bool updatedSerial; + bool narrow{false}; + bool haveNSEC3{false}; + NSEC3PARAMRecordContent ns3pr{}; + bool updatedSerial{false}; }; static void increaseSerial(const string& msgPrefix, const string& soaEditSetting, const updateContext& ctx); // Implement section 3.2.1 and 3.2.2 of RFC2136 // NOLINTNEXTLINE(readability-identifier-length) -int PacketHandler::checkUpdatePrerequisites(const DNSRecord* rr, DomainInfo* di) +static int checkUpdatePrerequisites(const DNSRecord* rr, DomainInfo* di) { if (rr->d_ttl != 0) { return RCode::FormErr; @@ -89,7 +89,7 @@ int PacketHandler::checkUpdatePrerequisites(const DNSRecord* rr, DomainInfo* di) // Method implements section 3.4.1 of RFC2136 // NOLINTNEXTLINE(readability-identifier-length) -int PacketHandler::checkUpdatePrescan(const DNSRecord* rr) +static int checkUpdatePrescan(const DNSRecord* rr) { // The RFC stats that d_class != ZCLASS, but we only support the IN class. if (rr->d_class != QClass::IN && rr->d_class != QClass::NONE && rr->d_class != QClass::ANY) { @@ -150,6 +150,7 @@ static bool mayPerformUpdate(const string& msgPrefix, const DNSRecord* rr, const // Caller has checked that we are allowed to insert the record and has handled // the NSEC3PARAM case already. // ctx is not const, may update updateSerial +// NOLINTNEXTLINE(readability-function-cognitive-complexity) static uint performInsert(const string& msgPrefix, const DNSRecord* rr, updateContext& ctx, vector& rrset, set& insnonterm, set& delnonterm) // NOLINT(readability-identifier-length) { uint changedRecords = 0; @@ -409,6 +410,7 @@ static uint performInsert(const string& msgPrefix, const DNSRecord* rr, updateCo // the code that calls this performUpdate(). // Caller has checked that we are allowed to delete the record and has handled // the NSEC3PARAM case already. +// NOLINTNEXTLINE(readability-function-cognitive-complexity) static uint performDelete(const string& msgPrefix, const DNSRecord* rr, const updateContext& ctx, vector& rrset, set& insnonterm, set& delnonterm) // NOLINT(readability-identifier-length) { vector recordsToDelete;