]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use DNSName::getLastLabel()
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 7 Apr 2017 10:51:25 +0000 (12:51 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 7 Apr 2017 10:51:25 +0000 (12:51 +0200)
pdns/syncres.cc

index a22600955d935df3f7d99cc707e23f6b5ff84fda..14f3c69bcf15d7feb230dd8bd8a3e763e4a9c96a 100644 (file)
@@ -795,13 +795,6 @@ bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType &qtype, vector
   return false;
 }
 
-static const DNSName getLastLabel(const DNSName& qname)
-{
-  DNSName ret(qname);
-  ret.trimToLabels(1);
-  return ret;
-}
-
 static inline void addTTLModifiedRecords(const vector<DNSRecord>& records, const uint32_t ttl, vector<DNSRecord>& ret) {
   for (const auto& rec : records) {
     DNSRecord r(rec);
@@ -1237,7 +1230,7 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co
         harvestNXRecords(lwr.d_records, ne);
         t_sstorage->negcache.add(ne);
         if(s_rootNXTrust && auth.isRoot()) { // We should check if it was forwarded here, see issue #5107
-          ne.d_name = getLastLabel(ne.d_name);
+          ne.d_name = ne.d_name.getLastLabel();
           t_sstorage->negcache.add(ne);
         }
       }