]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Prepend labels starting with an underscore
authorOtto <otto.moerbeek@open-xchange.com>
Fri, 26 Nov 2021 12:28:53 +0000 (13:28 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Fri, 26 Nov 2021 12:28:53 +0000 (13:28 +0100)
pdns/syncres.cc

index 426e8bb70963d75d0201156761ed2cded9b1fac1..26cf303a96325d88af79e3c384c22e7f7af58fdb 100644 (file)
@@ -814,6 +814,15 @@ int SyncRes::doResolve(const DNSName &qname, const QType qtype, vector<DNSRecord
         child.prependRawLabel(qname.getRawLabel(qnamelen - labels - 1));
         labels++;
       }
+      // rfc9156 section-2.3, append labels if they start with an underscore
+      while (labels < qnamelen) {
+        auto prependLabel = qname.getRawLabel(qnamelen - labels - 1);
+        if (prependLabel.at(0) != '_') {
+          break;
+        }
+        child.prependRawLabel(prependLabel);
+        labels++;
+      }
 
       QLOG("Step2 New child");