]> granicus.if.org Git - pdns/commitdiff
SRV record can have a '.' as final field, from which we would dutifully strip the...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 12 Jun 2013 14:17:57 +0000 (16:17 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 12 Jun 2013 14:19:17 +0000 (16:19 +0200)
pdns/dnsrecords.cc
pdns/misc.hh
pdns/resolver.cc
pdns/slavecommunicator.cc

index 611def6f33fc5507d4ff788a6d7cfa56ac06735f..6716cd0f2efe23de9df695b879acd59eafe4c2a3 100644 (file)
@@ -162,11 +162,9 @@ SRVRecordContent::SRVRecordContent(uint16_t preference, uint16_t weight, uint16_
 
 boilerplate_conv(SRV, ns_t_srv, 
                 conv.xfr16BitInt(d_preference);   conv.xfr16BitInt(d_weight);   conv.xfr16BitInt(d_port);
-                conv.xfrLabel(d_target);
+                conv.xfrLabel(d_target); 
                 )
 
-
-
 SOARecordContent::SOARecordContent(const string& mname, const string& rname, const struct soatimes& st) 
   : DNSRecordContent(ns_t_soa), d_mname(mname), d_rname(rname)
 {
index 7b1489aaac548fb2d156ddf639cc70e82c2298d4..0b0b4b704ad1f457691e629129b913e96540f837 100644 (file)
@@ -126,6 +126,7 @@ stringtok (Container &container, string const &in,
   }
 }
 
+// fills container with ranges, so {posbegin,posend}
 template <typename Container>
 void
 vstringtok (Container &container, string const &in,
index 6ffb3a11edcaa39b77b8092ceabce929fa837adb..8dae6bb749202c79c7b372b2d5c906d79b5d504e 100644 (file)
@@ -182,8 +182,11 @@ static int parseResult(MOADNSParser& mdp, const std::string& origQname, uint16_t
       rr.priority = atoi(rr.content.c_str());
       vector<pair<string::size_type, string::size_type> > fields;
       vstringtok(fields, rr.content, " ");
-      if(fields.size()==4)
+      if(fields.size()==4) {
+       if(fields[3].second - fields[3].first > 1) // strip dot, unless root
+         fields[3].second--;
         rr.content=string(rr.content.c_str() + fields[1].first, fields[3].second - fields[1].first);
+      }
     }
     result->push_back(rr);
   }
index e610f227d152a9dd75bb0ed83146e230e5b65f47..58aebbc6b6370ebec593ba67c27cd899dc26e37a 100644 (file)
@@ -193,8 +193,6 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
         }
 
         i->domain_id=domain_id;
-        if (i->qtype.getCode() == QType::SRV)
-          i->content = stripDot(i->content);
 
 #if 0
         if(i->qtype.getCode()>=60000)