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
446
Issues
446
List
Boards
Labels
Service Desk
Milestones
Merge Requests
72
Merge Requests
72
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
b3a9b362
Commit
b3a9b362
authored
Jan 08, 2013
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2313] Trivial: updates to some comments as a result of the second review.
parent
f8ad67f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/lib/dhcpsrv/option_space.cc
src/lib/dhcpsrv/option_space.cc
+3
-3
src/lib/dhcpsrv/tests/option_space_unittest.cc
src/lib/dhcpsrv/tests/option_space_unittest.cc
+2
-2
No files found.
src/lib/dhcpsrv/option_space.cc
View file @
b3a9b362
...
...
@@ -34,14 +34,14 @@ OptionSpace::validateName(const std::string& name) {
using
namespace
boost
::
algorithm
;
// Allowed characters are: lower or upper case letters, digits,
// underscores and
dashe
s. Empty option spaces are not allowed.
// underscores and
hyphen
s. Empty option spaces are not allowed.
if
(
all
(
name
,
boost
::
is_from_range
(
'a'
,
'z'
)
||
boost
::
is_from_range
(
'A'
,
'Z'
)
||
boost
::
is_digit
()
||
boost
::
is_any_of
(
"-_"
))
&&
!
name
.
empty
()
&&
// Hyphens a
re not allowed at the beginning and at
// the end of the option space name.
// Hyphens a
nd underscores are not allowed at the beginning
//
and at
the end of the option space name.
!
all
(
find_head
(
name
,
1
),
boost
::
is_any_of
(
"-_"
))
&&
!
all
(
find_tail
(
name
,
1
),
boost
::
is_any_of
(
"-_"
)))
{
return
(
true
);
...
...
src/lib/dhcpsrv/tests/option_space_unittest.cc
View file @
b3a9b362
...
...
@@ -77,8 +77,8 @@ TEST(OptionSpaceTest, validateName) {
EXPECT_FALSE
(
OptionSpace
::
validateName
(
" isc"
));
EXPECT_FALSE
(
OptionSpace
::
validateName
(
"isc with-space"
));
// Hyphens a
re not allowed at the beginning and at the end
// of the option space name.
// Hyphens a
nd underscores are not allowed at the beginning
//
and at the end
of the option space name.
EXPECT_FALSE
(
OptionSpace
::
validateName
(
"-isc"
));
EXPECT_FALSE
(
OptionSpace
::
validateName
(
"isc-"
));
EXPECT_FALSE
(
OptionSpace
::
validateName
(
"_isc"
));
...
...
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