From 7c44eb1634a9919a1e3aea4a66fe66044a7a45c8 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 7 Feb 2022 13:46:13 +0100 Subject: [PATCH] Very basic (non-alias mode only) of procesing of SVCB target as a name to be used for additionals A and AAAA's. --- pdns/syncres.cc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index af82a278cd..1f0b3ae5fc 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -222,8 +222,8 @@ int SyncRes::beginResolve(const DNSName &qname, const QType qtype, QClass qclass {QType::MX, {{QType::A, QType::AAAA}, false}}, //{QType::NS, {{QType::A, QType::AAAA}, false}}, {QType::SRV, {{QType::A, QType::AAAA}, false}}, - {QType::SVCB, {{}, false}}, - {QType::HTTPS, {{}, false}}, + {QType::SVCB, {{QType::A, QType::AAAA}, false}}, + {QType::HTTPS, {{QType::A, QType::AAAA}, false}}, {QType::NAPTR, {{}, false}} }; @@ -3131,10 +3131,25 @@ static bool allowAdditionalEntry(std::unordered_set& allowedAdditionals } return true; } - // Record ttypes below are candidates for this - case QType::SVCB: + case QType::SVCB: /* fall-through */ case QType::HTTPS: + if (auto svcbContent = getRR(rec)) { + if (svcbContent->getPriority() > 0) { + DNSName target = svcbContent->getTarget(); + if (target.isRoot()) { + target = rec.d_name; + } + allowedAdditionals.insert(target); + return true; + } + else { + // Alias mode not implemented yet + return false; + } + } + break; case QType::NAPTR: + // To be done default: return false; } -- 2.47.2