From: Bert Hubert Date: Sun, 27 Dec 2009 14:22:45 +0000 (+0000) Subject: prevent duplicate SOA from appearing in case a response contains a CNAME and a SOA X-Git-Tag: rec-3.2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10d31f4e95c7b24e6f77908823aae484bac5eac8;p=pdns prevent duplicate SOA from appearing in case a response contains a CNAME and a SOA zero the 'priority' field just to be sure in lwres.cc response handling git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1475 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/lwres.cc b/pdns/lwres.cc index 4b5ba0c86..5bcd79da4 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -57,7 +57,7 @@ string dns0x20(const std::string& in) /** lwr is only filled out in case 1 was returned, and even when returning 1 for 'success', lwr might contain DNS errors Never throws! */ -int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, LWResult *lwr) +int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, LWResultResult *lwr) { int len; int bufsize=1500; @@ -183,6 +183,7 @@ int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool do for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { DNSResourceRecord rr; + rr.priority = 0; rr.qtype=i->first.d_type; rr.qname=i->first.d_label; /* diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 1126f3d90..db65ec6f0 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -956,6 +956,7 @@ int SyncRes::doResolveAt(set nameservers, string auth, if(rr.qtype.getCode() == QType::NS) // people fiddle with the case rr.content=toLower(rr.content); // this must stay! (the cache can't be case-insensitive on the RHS of records) + tcache[make_pair(i->qname,i->qtype)].insert(rr); } } @@ -1029,7 +1030,8 @@ int SyncRes::doResolveAt(set nameservers, string auth, else if(!done && i->d_place==DNSResourceRecord::AUTHORITY && dottedEndsOn(qname,i->qname) && i->qtype.getCode()==QType::SOA && lwr.d_rcode==RCode::NoError) { LOG<qtype.getName()+"'") <qname;