]> granicus.if.org Git - pdns/commitdiff
prevent duplicate SOA from appearing in case a response contains a CNAME and a SOA
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 27 Dec 2009 14:22:45 +0000 (14:22 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 27 Dec 2009 14:22:45 +0000 (14:22 +0000)
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

pdns/lwres.cc
pdns/syncres.cc

index 4b5ba0c8613d8a6a4c1487bbc1ceff707582c9ee..5bcd79da49a4a4003ed786e1b16c0397c1d18bc4 100644 (file)
@@ -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;
       /* 
index 1126f3d90aa7d6e45c90d02f275937883eb4fd6f..db65ec6f0602b666021bea63cb0945ffa6015788 100644 (file)
@@ -956,6 +956,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> 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<string, CIStringCompare> 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<<prefix<<qname<<": got negative caching indication for '"<< (qname+"|"+i->qtype.getName()+"'") <<endl;
-          ret.push_back(*i);
+          if(!newtarget.empty())
+            ret.push_back(*i);
           
           NegCacheEntry ne;
           ne.d_qname=i->qname;