From: Otto Moerbeek Date: Fri, 2 Jun 2023 12:16:40 +0000 (+0200) Subject: delint X-Git-Tag: rec-4.10.0-alpha0~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12883%2Fhead;p=thirdparty%2Fpdns.git delint --- diff --git a/pdns/recursordist/rec-lua-conf.cc b/pdns/recursordist/rec-lua-conf.cc index 78e5cb90f3..4c471d2481 100644 --- a/pdns/recursordist/rec-lua-conf.cc +++ b/pdns/recursordist/rec-lua-conf.cc @@ -101,10 +101,10 @@ typedef std::unordered_map& zone, std::string& polName, boost::optional& defpol, bool& defpolOverrideLocal, uint32_t& maxTTL) { - if (have.count("policyName")) { + if (have.count("policyName") != 0) { polName = boost::get(have["policyName"]); } - if (have.count("defpol")) { + if (have.count("defpol") != 0) { defpol = DNSFilterEngine::Policy(); defpol->d_kind = (DNSFilterEngine::PolicyKind)boost::get(have["defpol"]); defpol->setName(polName); @@ -112,26 +112,28 @@ static void parseRPZParameters(rpzOptions_t& have, std::shared_ptrd_custom.push_back(DNSRecordContent::mastermake(QType::CNAME, QClass::IN, boost::get(have["defcontent"]))); - if (have.count("defttl")) + if (have.count("defttl") != 0) { defpol->d_ttl = static_cast(boost::get(have["defttl"])); - else + } + else { defpol->d_ttl = -1; // get it from the zone + } } - if (have.count("defpolOverrideLocalData")) { + if (have.count("defpolOverrideLocalData") != 0) { defpolOverrideLocal = boost::get(have["defpolOverrideLocalData"]); } } - if (have.count("maxTTL")) { + if (have.count("maxTTL") != 0) { maxTTL = boost::get(have["maxTTL"]); } - if (have.count("zoneSizeHint")) { + if (have.count("zoneSizeHint") != 0) { auto zoneSizeHint = static_cast(boost::get(have["zoneSizeHint"])); if (zoneSizeHint > 0) { zone->reserve(zoneSizeHint); } } - if (have.count("tags")) { + if (have.count("tags") != 0) { const auto tagsTable = boost::get>>(have["tags"]); std::unordered_set tags; for (const auto& tag : tagsTable) { @@ -139,21 +141,21 @@ static void parseRPZParameters(rpzOptions_t& have, std::shared_ptrsetTags(std::move(tags)); } - if (have.count("overridesGettag")) { + if (have.count("overridesGettag") != 0) { zone->setPolicyOverridesGettag(boost::get(have["overridesGettag"])); } - if (have.count("extendedErrorCode")) { + if (have.count("extendedErrorCode") != 0) { auto code = boost::get(have["extendedErrorCode"]); if (code > std::numeric_limits::max()) { throw std::runtime_error("Invalid extendedErrorCode value " + std::to_string(code) + " in RPZ configuration"); } zone->setExtendedErrorCode(static_cast(code)); - if (have.count("extendedErrorExtra")) { + if (have.count("extendedErrorExtra") != 0) { zone->setExtendedErrorExtra(boost::get(have["extendedErrorExtra"])); } } - if (have.count("includeSOA")) { + if (have.count("includeSOA") != 0) { zone->setIncludeSOA(boost::get(have["includeSOA"])); } }