]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Very basic (non-alias mode only) of procesing of SVCB target as a name to be used...
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 7 Feb 2022 12:46:13 +0000 (13:46 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 14 Feb 2022 19:09:49 +0000 (20:09 +0100)
pdns/syncres.cc

index af82a278cd51017dcdbb3ad8d6803cf07dda78d6..1f0b3ae5fcb60c66bf9f19238f030e2f21d57ad7 100644 (file)
@@ -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<DNSName>& 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<SVCBBaseRecordContent>(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;
   }