Permalink
Browse files

SRV record can have a '.' as final field, from which we would dutiful…

…ly strip the trailing ., leaving void, confusing everything. We now remove the trailing . in the right place, and not if we are trying to server '.'. Again thanks to Jelte & SIDN for catching this.
  • Loading branch information...
1 parent 70d5a66 commit 8655a4279b896bf4c1902b95f89978d31d07e101 @ahupowerdns ahupowerdns committed Jun 12, 2013
Showing with 6 additions and 6 deletions.
  1. +1 −3 pdns/dnsrecords.cc
  2. +1 −0 pdns/misc.hh
  3. +4 −1 pdns/resolver.cc
  4. +0 −2 pdns/slavecommunicator.cc
View
@@ -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)
{
View
@@ -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,
View
@@ -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);
}
@@ -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)

0 comments on commit 8655a42

Please sign in to comment.