Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
f998d613
Commit
f998d613
authored
Feb 03, 2011
by
Michal 'vorner' Vaner
Browse files
[trac505] Don't fail on too long synthesized names
Return YXDOMAIN instead.
parent
c5f4af2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/query.cc
View file @
f998d613
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
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