From: bert hubert Date: Tue, 24 Nov 2015 16:06:24 +0000 (+0100) Subject: cleanup abomination where we serialized dnsnames to strings X-Git-Tag: dnsdist-1.0.0-alpha1~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d076a01250cf67efd268b3677b6d68d45acddf4e;p=thirdparty%2Fpdns.git cleanup abomination where we serialized dnsnames to strings --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 0442042eed..b040e39c3d 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -567,8 +567,7 @@ void SyncRes::getBestNSFromCache(const DNSName &qname, const QType& qtype, vecto answer.qname=qname; answer.qtype=qtype.getCode(); for(const auto& dr : bestns) - answer.bestns.insert(make_pair(dr.d_name, dr.d_content->getZoneRepresentation())); - // XXX we are passing a DNSName through a string here! + answer.bestns.insert(make_pair(dr.d_name, std::dynamic_pointer_cast(dr.d_content)->getNS())); if(beenthere.count(answer)) { brokeloop=true; @@ -1213,7 +1212,7 @@ int SyncRes::doResolveAt(set nameservers, DNSName auth, bool flawedNSSe } else if(rec.d_place==DNSResourceRecord::ANSWER && rec.d_name == qname && rec.d_type==QType::CNAME && (!(qtype==QType(QType::CNAME)))) { ret.push_back(rec); - newtarget=DNSName(rec.d_content->getZoneRepresentation()); + newtarget=std::dynamic_pointer_cast(rec.d_content)->getTarget(); } else if(d_doDNSSEC && (rec.d_type==QType::RRSIG || rec.d_type==QType::NSEC || rec.d_type==QType::NSEC3) && rec.d_place==DNSResourceRecord::ANSWER){ if(rec.d_type != QType::RRSIG || rec.d_name == qname) @@ -1241,7 +1240,7 @@ int SyncRes::doResolveAt(set nameservers, DNSName auth, bool flawedNSSe else { LOG(prefix< '"<getZoneRepresentation()<<"', had '"<getZoneRepresentation())); + nsset.insert(std::dynamic_pointer_cast(rec.d_content)->getNS()); } else if(rec.d_place==DNSResourceRecord::AUTHORITY && qname.isPartOf(rec.d_name) && rec.d_type==QType::DS) { LOG(prefix< '"<getZoneRepresentation()<<"'"< > bestns; // FIXME400 right side really should be DNSName too + set > bestns; uint8_t qtype; // only A and AAAA anyhow bool operator<(const GetBestNSAnswer &b) const {