}
// Let's use whatever callout returned. Hopefully it is the same lease
- // we handled to it.
+ // we handed to it.
ctx.callout_handle_->getArgument("lease6", expired);
}
}
// Let's use whatever callout returned. Hopefully it is the same lease
- // we handled to it.
+ // we handed to it.
ctx.callout_handle_->getArgument("lease6", 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;
// 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 address 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.
}
// Some of the methods like reuseExpiredLease4 may set the old lease to point
- // to the lease which they remove/override. If is it not set, but we have
+ // to the lease which they remove/override. If it is 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) {
// 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
// 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 needs 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_);
}
// Let's use whatever callout returned. Hopefully it is the same lease
- // we handled to it.
+ // we handed to it.
callout_handle->getArgument("lease4", 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;
}
// Let's use whatever callout returned. Hopefully it is the same lease
- // we handled to it.
+ // we handed to it.
ctx.callout_handle_->getArgument("lease4", expired);
}
// 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,
}
-// 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;
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_,
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);
}
// - 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 and 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(),
ASSERT_TRUE(offered_lease);
EXPECT_NE(offered_lease->addr_.toText(), "192.0.2.101");
- // Client A tried to acquire the lease. It should succeed. At this point
+ // Client A trys 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_,