]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do not insert ENT when delegate above delegate
authorRuben d'Arco <cyclops@prof-x.net>
Thu, 9 May 2013 18:18:53 +0000 (20:18 +0200)
committermind04 <mind04@monshouwer.org>
Fri, 12 Jul 2013 15:26:19 +0000 (17:26 +0200)
consider these records:
a.b.c.delegate.test.dyndns 600 NS ns1.test.dyndns
c.delegate.test.dyndns 600 NS ns1.test.dyndns

When deleting c.delegate.test.dynds we would search for records below
and find a.b.c.delegate.test.dyndns. This would cause a ENT to be inserted.

So, if we delete something at a high level, we make sure we ignore NS records that are below it when searching to see
if we need to insert ENT's.

pdns/rfc2136handler.cc

index e5a1444aca15471b92918ba52d01b24dc707c6a9..ff3e7c7711ab13f00945d824cf1813fd837f2037 100755 (executable)
@@ -358,7 +358,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *
         vector<string> changeAuth;
         di->backend->listSubZone(rrLabel, di->id);
         while (di->backend->get(rec)) {
-          if (rec.qtype.getCode()) // skip ENT records, they are always false.
+          if (rec.qtype.getCode()) // skip ENT records, they are always auth=false
             changeAuth.push_back(rec.qname);
         }
         for (vector<string>::const_iterator changeRec=changeAuth.begin(); changeRec!=changeAuth.end(); ++changeRec) {
@@ -383,7 +383,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *
       while (di->backend->get(rec)) {
         if (rec.qname == rrLabel && !count(recordsToDelete.begin(), recordsToDelete.end(), rec))
           foundOtherWithSameName = true;
-        if (rec.qname != rrLabel)
+        if (rec.qname != rrLabel && rec.qtype.getCode() != QType::NS) //Skip NS records, as this would be a delegate that we can ignore as this does not require us to create a ENT
           foundDeeper = true;
       }