From: Remi Gacogne Date: Mon, 19 Dec 2016 16:43:18 +0000 (+0100) Subject: Auth: Cleanup `DNSName::getRawLabels()` usage X-Git-Tag: dnsdist-1.1.0~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4791%2Fhead;p=thirdparty%2Fpdns.git Auth: Cleanup `DNSName::getRawLabels()` usage No real issue I'm aware of, but it's cleaner that way. --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 3fc3b79518..d5c40f66f4 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -334,7 +334,7 @@ vector PacketHandler::getBestDNAMESynth(DNSPacket *p, SOAData& sd if(!ret.empty()) return ret; if(subdomain.countLabels()) - prefix+= DNSName(subdomain.getRawLabels()[0]); // XXX DNSName pain this feels wrong + prefix.appendRawLabel(subdomain.getRawLabels()[0]); // XXX DNSName pain this feels wrong if(subdomain == sd.qname) // stop at SOA break; diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 67c0a76d25..75b227270a 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -638,7 +638,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect for(const auto &i: tlsas) { DNSName name = DNSName(i); - name.trimToLabels(name.getRawLabels().size()-2); + name.trimToLabels(name.countLabels()-2); if (cnames.find(name) == cnames.end() && noncnames.find(name) == noncnames.end()) { // No specific record for the name in the TLSA record exists, this // is already worth emitting a warning. Let's see if a wildcard exist.