Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
Kea
Commits
2aa24772
Commit
2aa24772
authored
Dec 17, 2012
by
JINMEI Tatuya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2429] define MAX_TTL in rrttl.h, as its bare value, not in form of RRTTL
parent
ed49f68c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
src/lib/dns/master_loader.cc
src/lib/dns/master_loader.cc
+1
-7
src/lib/dns/rrttl.cc
src/lib/dns/rrttl.cc
+4
-0
src/lib/dns/rrttl.h
src/lib/dns/rrttl.h
+11
-0
No files found.
src/lib/dns/master_loader.cc
View file @
2aa24772
...
...
@@ -52,7 +52,6 @@ public:
const
MasterLoaderCallbacks
&
callbacks
,
const
AddRRCallback
&
add_callback
,
MasterLoader
::
Options
options
)
:
MAX_TTL
(
0x7fffffff
),
lexer_
(),
zone_origin_
(
zone_origin
),
zone_class_
(
zone_class
),
...
...
@@ -158,7 +157,7 @@ private:
// RR and the lexer is positioned at the next line. It's just for
// calculating the accurate source line when callback is necessary.
void
limitTTL
(
RRTTL
&
ttl
,
bool
post_parsing
)
{
if
(
ttl
>
MAX_TTL
)
{
if
(
ttl
.
getValue
()
>
RRTTL
::
MAX_TTL
)
{
const
size_t
src_line
=
lexer_
.
getSourceLine
()
-
(
post_parsing
?
1
:
0
);
callbacks_
.
warning
(
lexer_
.
getSourceName
(),
src_line
,
...
...
@@ -306,11 +305,6 @@ private:
}
private:
// RFC2181 Section 8 specifies TTLs are unsigned 32-bit integer,
// effectively limiting the maximum value to 2^32-1. This constant
// represent a TTL of the max value.
const
RRTTL
MAX_TTL
;
MasterLexer
lexer_
;
const
Name
zone_origin_
;
const
RRClass
zone_class_
;
...
...
src/lib/dns/rrttl.cc
View file @
2aa24772
...
...
@@ -57,6 +57,10 @@ Unit units[] = {
namespace
isc
{
namespace
dns
{
// The actual definition of a static const member, in case it's address is
// needed.
const
uint32_t
RRTTL
::
MAX_TTL
;
namespace
{
bool
parseTTLStr
(
const
string
&
ttlstr
,
uint32_t
&
ttlval
,
string
*
error_txt
)
{
...
...
src/lib/dns/rrttl.h
View file @
2aa24772
...
...
@@ -267,6 +267,17 @@ public:
{
return
(
ttlval_
>
other
.
ttlval_
);
}
//@}
///
/// \name Protocol constants
///
//@{
/// \brief Max allowable value for TTLs, as defined in RFC2181, Sec. 8.
///
/// \note At the moment an RRTTL object can have a value larger than
/// this limit. We may revisit it in a future version.
static
const
uint32_t
MAX_TTL
=
0x7fffffff
;
//@}
private:
uint32_t
ttlval_
;
};
...
...
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