Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
0133383f
Commit
0133383f
authored
Mar 04, 2015
by
Shawn Routhier
Browse files
[3694] Fix up some typos
parent
3e99b085
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/alloc_engine.cc
View file @
0133383f
...
...
@@ -874,7 +874,7 @@ AllocEngine::reuseExpiredLease(Lease6Ptr& expired, ClientContext6& ctx,
}
// Let's use whatever callout returned. Hopefully it is the same lease
// we hand
l
ed to it.
// we handed to it.
ctx
.
callout_handle_
->
getArgument
(
"lease6"
,
expired
);
}
...
...
@@ -936,7 +936,7 @@ Lease6Ptr AllocEngine::createLease6(ClientContext6& ctx,
}
// Let's use whatever callout returned. Hopefully it is the same lease
// we hand
l
ed to it.
// we handed to it.
ctx
.
callout_handle_
->
getArgument
(
"lease6"
,
lease
);
}
...
...
@@ -1100,7 +1100,7 @@ AllocEngine::extendLease6(ClientContext6& ctx, Lease6Ptr lease) {
HooksManager
::
callCallouts
(
hook_point
,
*
callout_handle
);
// Callouts decided to skip the next processing step. The next
// processing step would
to
actually renew the lease, so skip at this
// processing step would actually renew the lease, so skip at this
// stage means "keep the old lease as it is".
if
(
callout_handle
->
getSkip
())
{
skip
=
true
;
...
...
@@ -1305,7 +1305,7 @@ AllocEngine::discoverLease4(AllocEngine::ClientContext4& ctx) {
// Check if there is a reservation for the client. If there is, we want to
// assign the reserved address, rather than any other one.
if
(
ctx
.
host_
)
{
// If the client doesn't have a lease or the leased addres is different
// If the client doesn't have a lease or the leased addres
s
is different
// than the reserved one then let's try to allocate the reserved address.
// Otherwise the address that the client has is the one for which it
// has a reservation, so just renew it.
...
...
@@ -1367,7 +1367,7 @@ AllocEngine::discoverLease4(AllocEngine::ClientContext4& ctx) {
}
// Some of the methods like reuseExpiredLease4 may set the old lease to point
// to the lease which they remove/override. If i
s
i
t
not set, but we have
// to the lease which they remove/override. If i
t
i
s
not set, but we have
// found that the client has the lease the client's lease is the one
// to return as an old lease.
if
(
!
ctx
.
old_lease_
&&
client_lease
)
{
...
...
@@ -1393,7 +1393,7 @@ AllocEngine::requestLease4(AllocEngine::ClientContext4& ctx) {
// address which it is requesting or renewing. That is, the client should
// either use the requested IP address option or set the ciaddr. However,
// we try to be liberal and allow the clients to not specify an address
// in which case the allocation engine will pick
the
suitable address
// in which case the allocation engine will pick
a
suitable address
// for the client.
if
(
!
ctx
.
requested_address_
.
isV4Zero
())
{
// If the client has specified an address, make sure this address
...
...
@@ -1484,7 +1484,7 @@ AllocEngine::requestLease4(AllocEngine::ClientContext4& ctx) {
// If we allocated the lease for the client, but the client already had a
// lease, we will need to return the pointer to the previous lease and
// the previous lease need to be removed from the lease database.
// the previous lease need
s
to be removed from the lease database.
if
(
new_lease
&&
client_lease
)
{
ctx
.
old_lease_
=
Lease4Ptr
(
new
Lease4
(
*
client_lease
));
lease_mgr
.
deleteLease
(
client_lease
->
addr_
);
...
...
@@ -1558,7 +1558,7 @@ Lease4Ptr AllocEngine::createLease4(const SubnetPtr& subnet,
}
// Let's use whatever callout returned. Hopefully it is the same lease
// we hand
l
ed to it.
// we handed to it.
callout_handle
->
getArgument
(
"lease4"
,
lease
);
}
...
...
@@ -1632,7 +1632,7 @@ AllocEngine::renewLease4(const Lease4Ptr& lease,
*
ctx
.
callout_handle_
);
// Callouts decided to skip the next processing step. The next
// processing step would
to
actually renew the lease, so skip at this
// processing step would actually renew the lease, so skip at this
// stage means "keep the old lease as it is".
if
(
ctx
.
callout_handle_
->
getSkip
())
{
skip
=
true
;
...
...
@@ -1707,7 +1707,7 @@ AllocEngine::reuseExpiredLease4(Lease4Ptr& expired,
}
// Let's use whatever callout returned. Hopefully it is the same lease
// we hand
l
ed to it.
// we handed to it.
ctx
.
callout_handle_
->
getArgument
(
"lease4"
,
expired
);
}
...
...
src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
View file @
0133383f
...
...
@@ -143,7 +143,7 @@ TEST_F(AllocEngine4Test, allocWithValidHint4) {
// This test checks if the allocation with a hint that is in range,
// in pool, but is currently used
)
can succeed
// in pool, but is currently used can succeed
TEST_F
(
AllocEngine4Test
,
allocWithUsedHint4
)
{
boost
::
scoped_ptr
<
AllocEngine
>
engine
;
ASSERT_NO_THROW
(
engine
.
reset
(
new
AllocEngine
(
AllocEngine
::
ALLOC_ITERATIVE
,
...
...
@@ -189,7 +189,7 @@ TEST_F(AllocEngine4Test, allocWithUsedHint4) {
}
// This test checks if
the
allocation with a hint that is out the blue
// This test checks if
an
allocation with a hint that is out
of
the blue
// can succeed. The invalid hint should be ignored completely.
TEST_F
(
AllocEngine4Test
,
allocBogusHint4
)
{
boost
::
scoped_ptr
<
AllocEngine
>
engine
;
...
...
@@ -197,7 +197,7 @@ TEST_F(AllocEngine4Test, allocBogusHint4) {
100
,
false
)));
ASSERT_TRUE
(
engine
);
// Client would like to get a
3000::abc
lease, which does not belong to any
// Client would like to get a
10.1.1.1
lease, which does not belong to any
// supported lease. Allocation engine should ignore it and carry on
// with the normal allocation
Lease4Ptr
lease
=
engine
->
allocateLease4
(
subnet_
,
clientid_
,
hwaddr_
,
...
...
@@ -571,10 +571,10 @@ TEST_F(AllocEngine4Test, requestOtherClientLease) {
ASSERT_FALSE
(
new_lease
);
new_lease
=
engine
.
allocateLease4
(
subnet_
,
clientid_
,
hwaddr_
,
IOAddress
(
"192.0.2.102"
),
false
,
false
,
""
,
true
,
CalloutHandlePtr
(),
old_lease_
);
IOAddress
(
"192.0.2.102"
),
false
,
false
,
""
,
true
,
CalloutHandlePtr
(),
old_lease_
);
ASSERT_TRUE
(
new_lease
);
}
...
...
@@ -854,7 +854,7 @@ TEST_F(AllocEngine4Test, reservedAddressHijacked) {
// - Client B has a reservation for the address in use by client A.
// - Client B sends a DHCPDISCOVER.
// - Server determines that the reserved address is in use by a different client
// so it offers an
d
address from the dynamic pool.
// so it offers an address from the dynamic pool.
TEST_F
(
AllocEngine4Test
,
reservedAddressHijackedFakeAllocation
)
{
// Create a reservation for the client B.
HostPtr
host
(
new
Host
(
&
hwaddr_
->
hwaddr_
[
0
],
hwaddr_
->
hwaddr_
.
size
(),
...
...
@@ -1184,7 +1184,7 @@ TEST_F(AllocEngine4Test, reservedAddressConflictResolution) {
ASSERT_TRUE
(
offered_lease
);
EXPECT_NE
(
offered_lease
->
addr_
.
toText
(),
"192.0.2.101"
);
// Client A tr
ied
to acquire the lease. It should succeed. At this point
// Client A tr
ys
to acquire the lease. It should succeed. At this point
// the previous lease should be released and become available for the
// Client B.
Lease4Ptr
allocated_lease
=
engine
.
allocateLease4
(
subnet_
,
clientid_
,
...
...
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