From 9a1e060b703255642f91fd04a674bcca20973d68 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 7 Apr 2017 12:51:25 +0200 Subject: [PATCH] Use DNSName::getLastLabel() --- pdns/syncres.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index a22600955d..14f3c69bcf 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -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& records, const uint32_t ttl, vector& 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); } } -- 2.47.2