Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
d619eab6
Commit
d619eab6
authored
Feb 11, 2011
by
Michal 'vorner' Vaner
Browse files
[trac553] Cancel wildcard on existing subdomain
parent
6fbb0f72
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/memory_datasrc.cc
View file @
d619eab6
...
...
@@ -434,6 +434,33 @@ struct MemoryZone::MemoryZoneImpl {
* is known to exist).
*/
if
(
node
->
getFlag
(
DOMAINFLAG_WILD
))
{
/* Should we cancel this match?
*
* If we compare with some node and get a common ancestor,
* it might mean we are comparing with a non-wildcard node.
* In that case, we check which part is common. If we have
* something in common that lives below the node we got
* (the one above *), then we should cancel the match
* according to section 4.3.3 of RFC 1034 (as the name
* between the wildcard domain and the query name is known
* to exist).
*
* Because the way the tree stores relative names, we will
* have exactly one common label (the ".") in case we have
* nothing common under the node we got and we will get
* more common labels otherwise (yes, this relies on the
* internal RBTree structure, which leaks out trough this
* little bit).
*
* If the empty non-terminal node actually exists in the
* tree, then this cancellation is not needed, because we
* will not get here at all.
*/
if
(
node_path
.
getLastComparisonResult
().
getRelation
()
==
NameComparisonResult
::
COMMONANCESTOR
&&
node_path
.
getLastComparisonResult
().
getCommonLabels
()
>
1
)
{
return
(
FindResult
(
NXDOMAIN
,
ConstRRsetPtr
()));
}
Name
wildcard
(
Name
(
"*"
).
concatenate
(
node_path
.
getAbsoluteName
()));
DomainTree
::
Result
result
(
domains_
.
find
(
wildcard
,
&
node
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment