From: Otto Moerbeek Date: Mon, 7 Feb 2022 12:46:13 +0000 (+0100) Subject: Very basic (non-alias mode only) of procesing of SVCB target as a name to be used... X-Git-Tag: rec-4.7.0-alpha1~8^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c44eb1634a9919a1e3aea4a66fe66044a7a45c8;p=thirdparty%2Fpdns.git Very basic (non-alias mode only) of procesing of SVCB target as a name to be used for additionals A and AAAA's. --- 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; }