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
445
Issues
445
List
Boards
Labels
Service Desk
Milestones
Merge Requests
71
Merge Requests
71
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
92e4f34d
Commit
92e4f34d
authored
Dec 27, 2012
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2320] Default value for getPool() now works for both v4 and v6.
parent
c2e9d347
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/lib/dhcpsrv/subnet.cc
src/lib/dhcpsrv/subnet.cc
+8
-5
No files found.
src/lib/dhcpsrv/subnet.cc
View file @
92e4f34d
...
...
@@ -87,12 +87,15 @@ void Subnet::addPool(const PoolPtr& pool) {
}
PoolPtr
Subnet
::
getPool
(
isc
::
asiolink
::
IOAddress
hint
)
{
if
(
dynamic_cast
<
Subnet6
*>
(
this
))
{
if
(
hint
.
toText
()
==
"::"
)
{
hint
=
IOAddress
(
"0.0.0.0"
);
}
}
// This is an ugly workaround for having the ability to have default value
// for both protocol families. The alternative to this would be to define
// getPool() as pure virtual and have Subnet4 and Subnet6 provide their
// own methods. Those two implementation would only differ by a default
// value, so it would just include duplicate code.
if
(
dynamic_cast
<
Subnet6
*>
(
this
)
&&
hint
.
toText
()
==
"::"
)
{
hint
=
IOAddress
(
"0.0.0.0"
);
}
PoolPtr
candidate
;
for
(
PoolCollection
::
iterator
pool
=
pools_
.
begin
();
pool
!=
pools_
.
end
();
++
pool
)
{
...
...
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