From: Pieter Lexis Date: Wed, 15 Jul 2015 14:48:29 +0000 (+0200) Subject: syncres: fix moreSpecificThan() X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~57^2~3^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a1010f711ff2d31464a853e7f7ab7931a327d69;p=thirdparty%2Fpdns.git syncres: fix moreSpecificThan() --- 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<<"'"<