Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
415
Issues
415
List
Boards
Labels
Service Desk
Milestones
Merge Requests
65
Merge Requests
65
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
b9fa6ce6
Commit
b9fa6ce6
authored
Dec 17, 2012
by
JINMEI Tatuya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2429] on second thought, define max rrttl as an object
parent
2aa24772
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
src/lib/dns/master_loader.cc
src/lib/dns/master_loader.cc
+1
-1
src/lib/dns/rrttl.cc
src/lib/dns/rrttl.cc
+0
-4
src/lib/dns/rrttl.h
src/lib/dns/rrttl.h
+7
-2
src/lib/dns/tests/rrttl_unittest.cc
src/lib/dns/tests/rrttl_unittest.cc
+4
-0
No files found.
src/lib/dns/master_loader.cc
View file @
b9fa6ce6
...
...
@@ -157,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
.
getValue
()
>
RRTTL
::
MAX_TTL
)
{
if
(
ttl
>
RRTTL
::
MAX
()
)
{
const
size_t
src_line
=
lexer_
.
getSourceLine
()
-
(
post_parsing
?
1
:
0
);
callbacks_
.
warning
(
lexer_
.
getSourceName
(),
src_line
,
...
...
src/lib/dns/rrttl.cc
View file @
b9fa6ce6
...
...
@@ -57,10 +57,6 @@ 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 @
b9fa6ce6
...
...
@@ -271,11 +271,16 @@ public:
/// \name Protocol constants
///
//@{
/// \brief Max allowable value for TTLs, as defined in RFC2181, Sec. 8.
/// \brief The TTL of the max allowable value, per RFC2181 Section 8.
///
/// The max value is the largest unsigned 31 bit integer, 2^31-1.
///
/// \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
;
static
const
RRTTL
MAX
()
{
static
const
RRTTL
max_ttl
(
0x7fffffff
);
return
(
max_ttl
);
}
//@}
private:
...
...
src/lib/dns/tests/rrttl_unittest.cc
View file @
b9fa6ce6
...
...
@@ -273,6 +273,10 @@ TEST_F(RRTTLTest, gthan) {
EXPECT_FALSE
(
ttl_small
>
ttl_large
);
}
TEST_F
(
RRTTLTest
,
maxTTL
)
{
EXPECT_EQ
((
1
<<
31
)
-
1
,
RRTTL
::
MAX
()
::
getValue
());
}
// test operator<<. We simply confirm it appends the result of toText().
TEST_F
(
RRTTLTest
,
LeftShiftOperator
)
{
ostringstream
oss
;
...
...
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