diff --git a/pdns/lua-auth4.cc b/pdns/lua-auth4.cc index 3efd2d7be7d5..77f7caa9035e 100644 --- a/pdns/lua-auth4.cc +++ b/pdns/lua-auth4.cc @@ -93,13 +93,11 @@ void AuthLua4::postLoad() { } bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const DNSResourceRecord& in, vector& out) { - luacall_axfr_filter_t::result_type ret; - int rcode; - - if (d_axfr_filter == nullptr) return false; + if (!d_axfr_filter) { + return false; + } - ret = d_axfr_filter(remote, zone, in); - rcode = std::get<0>(ret); + const auto& [rcode, rows] = d_axfr_filter(remote, zone, in); if (rcode < 0) { // no modification, handle normally return false; @@ -114,8 +112,6 @@ bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const else throw PDNSException("Cannot understand return code "+std::to_string(rcode)+" in axfr filter response"); - const auto& rows = std::get<1>(ret); - try { for(const auto& row: rows) { DNSResourceRecord rec; diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 79f3476df4a0..15d241682e78 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -652,13 +652,7 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con } } - for (const auto &svcb : svcbTargets) { - const auto& name = std::get<0>(svcb); - const auto& target = std::get<2>(svcb); - auto prio = std::get<1>(svcb); - auto v4hintsAuto = std::get<3>(svcb); - auto v6hintsAuto = std::get<4>(svcb); - + for (const auto& [name, prio, target, v4hintsAuto, v6hintsAuto] : svcbTargets) { if (name == target) { cout<<"[Error] SVCB record "<(httpsRecord); - const auto& target = std::get<2>(httpsRecord); - auto prio = std::get<1>(httpsRecord); - auto v4hintsAuto = std::get<3>(httpsRecord); - auto v6hintsAuto = std::get<4>(httpsRecord); - + for (const auto& [name, prio, target, v4hintsAuto, v6hintsAuto] : httpsTargets) { if (name == target) { cout<<"[Error] HTTPS record "< > StatBag::getRing(const string &name) vector > ret; if (d_comboRings.count(name)) { - typedef pair stor_t; - vector raw =d_comboRings[name].lock()->get(); - for(const stor_t& stor : raw) { - ret.emplace_back(stor.first.ca.toString(), stor.second); + for (const auto& [addr, num] : d_comboRings[name].lock()->get()) { + ret.emplace_back(addr.ca.toString(), num); } } else if (d_dnsnameqtyperings.count(name)) { - auto raw = d_dnsnameqtyperings[name].lock()->get(); - for (auto const &e : raw) { - ret.emplace_back(std::get<0>(e.first).toLogString() + "/" + std::get<1>(e.first).toString(), e.second); + for (auto const& [d, t] : d_dnsnameqtyperings[name].lock()->get()) { + ret.emplace_back(std::get<0>(d).toLogString() + "/" + std::get<1>(d).toString(), t); } } return ret;