Commit 6fbb0f72 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac553] Cancel wildcard at empty existing domain

We check to see if there's an empty non-terminal domain before check for
wildcard. If it is detected, there exists a subdomain and therefore we
should not do a wildcard check.
parent 76e1d3b2
......@@ -416,8 +416,22 @@ struct MemoryZone::MemoryZoneImpl {
return (FindResult(DELEGATION, prepareRRset(name,
state.rrset_, rename)));
}
// If the RBTree search stopped at a node for a super domain
// of the search name, it means the search name exists in
// the zone but is empty. Treat it as NXRRSET.
if (node_path.getLastComparisonResult().getRelation() ==
NameComparisonResult::SUPERDOMAIN) {
return (FindResult(NXRRSET, ConstRRsetPtr()));
}
/*
* No redirection anywhere. Let's try if it is a wildcard.
*
* The wildcard is checked after the empty non-terminal domain
* case above, because if that one triggers, it means we should
* not match according to 4.3.3 of RFC 1034 (the query name
* is known to exist).
*/
if (node->getFlag(DOMAINFLAG_WILD)) {
Name wildcard(Name("*").concatenate(
......@@ -438,14 +452,6 @@ struct MemoryZone::MemoryZoneImpl {
break;
}
// If the RBTree search stopped at a node for a super domain
// of the search name, it means the search name exists in
// the zone but is empty. Treat it as NXRRSET.
if (node_path.getLastComparisonResult().getRelation() ==
NameComparisonResult::SUPERDOMAIN) {
return (FindResult(NXRRSET, ConstRRsetPtr()));
}
// fall through
case DomainTree::NOTFOUND:
return (FindResult(NXDOMAIN, ConstRRsetPtr()));
......
Markdown is supported
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