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
450
Issues
450
List
Boards
Labels
Service Desk
Milestones
Merge Requests
75
Merge Requests
75
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
4f2cfbfa
Commit
4f2cfbfa
authored
Aug 07, 2013
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[3059] Removed the C-string from the DdnsDomainListMgr::matchDomain.
parent
40b95610
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/bin/d2/d2_config.cc
src/bin/d2/d2_config.cc
+2
-3
No files found.
src/bin/d2/d2_config.cc
View file @
4f2cfbfa
...
...
@@ -103,7 +103,6 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
// Iterate over the domain map looking for the domain which matches
// the longest portion of the given fqdn.
const
char
*
req_name
=
fqdn
.
c_str
();
size_t
req_len
=
fqdn
.
size
();
size_t
match_len
=
0
;
DdnsDomainMapPair
map_pair
;
...
...
@@ -118,7 +117,7 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
// If the lengths are identical and the names match we're done.
if
(
req_len
==
dom_len
)
{
if
(
req_name
==
domain_name
)
{
if
(
fqdn
==
domain_name
)
{
// exact match, done
domain
=
map_pair
.
second
;
return
(
true
);
...
...
@@ -129,7 +128,7 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
// comparison if the adjustment lands on a boundary. This
// prevents "onetwo.net" from matching "two.net".
size_t
offset
=
req_len
-
dom_len
;
if
((
req_name
[
offset
-
1
]
==
'.'
)
&&
if
((
fqdn
[
offset
-
1
]
==
'.'
)
&&
(
fqdn
.
compare
(
offset
,
std
::
string
::
npos
,
domain_name
)
==
0
))
{
// Fqdn contains domain name, keep it if its better than
// any we have matched so far.
...
...
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