From: Peter van Dijk Date: Tue, 2 Apr 2024 07:39:11 +0000 (+0200) Subject: pdnsutil check-zone: accept LUA A/AAAA as SVCB address targets X-Git-Tag: rec-5.1.0-alpha1~48^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee8d0b2f879e33028e53eab87b71becea4df1f42;hp=e472f314a4adfc357d8917de361aded0aabee39f;p=thirdparty%2Fpdns.git pdnsutil check-zone: accept LUA A/AAAA as SVCB address targets --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 98cbf55a8..6bc3d443c 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1,3 +1,4 @@ +#include "dnsrecords.hh" #include #ifdef HAVE_CONFIG_H #include "config.h" @@ -250,7 +251,7 @@ static bool rectifyAllZones(DNSSECKeeper &dk, bool quiet = false) return result; } -static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vector* suppliedrecords=nullptr) +static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vector* suppliedrecords=nullptr) // NOLINTNEXTLINE(readability-function-cognitive-complexity) { uint64_t numerrors=0, numwarnings=0; @@ -377,6 +378,14 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con if(rr.qtype.getCode() == QType::A || rr.qtype.getCode() == QType::AAAA) { addresses.insert(rr.qname); } + if(rr.qtype.getCode() == QType::LUA) { + shared_ptr drc(DNSRecordContent::make(rr.qtype.getCode(), QClass::IN, rr.content)); + auto luarec = std::dynamic_pointer_cast(drc); + QType qtype = luarec->d_type; + if(qtype == QType::A || qtype == QType::AAAA) { + addresses.insert(rr.qname); + } + } if(rr.qtype.getCode() == QType::A) { arecords.insert(rr.qname); }