From: Ruben d'Arco Date: Thu, 9 May 2013 18:18:53 +0000 (+0200) Subject: Do not insert ENT when delegate above delegate X-Git-Tag: rec-3.6.0-rc1~556^2~3^2~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a0a9f8a221bc54589b64041217502a6fd4869b4;p=thirdparty%2Fpdns.git Do not insert ENT when delegate above delegate 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. --- diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index e5a1444aca..ff3e7c7711 100755 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -358,7 +358,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * vector 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::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; }