From ee8d0b2f879e33028e53eab87b71becea4df1f42 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Tue, 2 Apr 2024 09:39:11 +0200 Subject: [PATCH] pdnsutil check-zone: accept LUA A/AAAA as SVCB address targets --- pdns/pdnsutil.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 98cbf55a8f..6bc3d443c6 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); } -- 2.47.2