From 6a1010f711ff2d31464a853e7f7ab7931a327d69 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 15 Jul 2015 16:48:29 +0200 Subject: [PATCH] syncres: fix moreSpecificThan() --- pdns/syncres.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 19b32741b7..eda5eaeaae 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -787,10 +787,9 @@ bool SyncRes::doCacheCheck(const DNSName &qname, const QType &qtype, vector b.countLabels(); + return (a.isPartOf(b) && a.countLabels() > b.countLabels()); } struct speedOrder @@ -1176,7 +1175,7 @@ int SyncRes::doResolveAt(set nameservers, DNSName auth, bool flawedNSSe done=true; ret.push_back(*i); } - else if(i->d_place==DNSResourceRecord::AUTHORITY && dottedEndsOn(qname,i->qname) && i->qtype.getCode()==QType::NS) { + else if(i->d_place==DNSResourceRecord::AUTHORITY && qname.isPartOf(i->qname) && i->qtype.getCode()==QType::NS) { if(moreSpecificThan(i->qname,auth)) { newauth=i->qname; LOG(prefix<qname.toString()<<"' -> '"<content<<"'"<