Commit f998d613 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac505] Don't fail on too long synthesized names

Return YXDOMAIN instead.
parent c5f4af2f
......@@ -177,16 +177,28 @@ Query::process() const {
// by that)
RRsetPtr cname(new RRset(qname_, rrset->getClass(),
RRType::CNAME(), rrset->getTTL()));
// Construct the new target by replacing the end
cname->addRdata(rdata::generic::CNAME(qname_.split(0,
qname_.getLabelCount() -
rrset->getName().getLabelCount()).concatenate(
dname.getDname())));
rrset = cname;
// If this was ANY, act as it wasn't, because we put the CNAME
// into rrset, not to target and there's nothing else.
// TODO: This might need to be changed when CNAME gets chaining.
qtype_is_any = false;
try {
// Construct the new target by replacing the end
cname->addRdata(rdata::generic::CNAME(qname_.split(0,
qname_.getLabelCount() -
rrset->getName().getLabelCount()).concatenate(
dname.getDname())));
rrset = cname;
// If this was ANY, act as it wasn't, because we put the
// CNAME into rrset, not to target and there's nothing else.
// TODO: This might need to be changed when CNAME gets
// chaining.
qtype_is_any = false;
}
/*
* In case the synthetized name is too long, section 4.1 of RFC 2672
* mandates we return YXDOMAIN.
*/
catch (const isc::dns::TooLongName&) {
response_.setRcode(Rcode::YXDOMAIN());
getAuthAdditional(*result.zone);
return;
}
// No break; here, fall trough.
}
case Zone::CNAME:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment