Commit 76a78c53 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3694] Changes as a result of the second code review.

parent 3e85e573
...@@ -508,19 +508,21 @@ TEST_F(DORATest, reservation) { ...@@ -508,19 +508,21 @@ TEST_F(DORATest, reservation) {
// Client A still holds this address. // Client A still holds this address.
// 13. Client B uses 4-way exchange to obtain a new lease. // 13. Client B uses 4-way exchange to obtain a new lease.
// 14. The server determines that the Client B has a reservation for the // 14. The server determines that the Client B has a reservation for the
// address which is in use by Client A. The server drops the client's // address which is in use by Client A and offers an address different
// DHCPDISCOVER message. // than reserved.
// 15. Client A renews the lease. // 15. Client B requests the allocation of the offered address and the server
// 16. The server determines that the address that Client A is using is reserved // allocates this address.
// 16. Client A renews the lease.
// 17. The server determines that the address that Client A is using is reserved
// for Client B. The server returns DHCPNAK to the Client A. // for Client B. The server returns DHCPNAK to the Client A.
// 17. Client B uses 4-way exchange to obtain the reserved lease but the lease // 18. Client B uses 4-way exchange to obtain the reserved lease but the lease
// for the Client A hasn't been removed yet. Client B's DHCPDISCOVER // for the Client A hasn't been removed yet. Client B is assigned the same
// message is dropped again. // address it has been using.
// 18. Client A uses 4-way exchange to allocate a new lease. // 19. Client A uses 4-way exchange to allocate a new lease.
// 19. The server allocates a new lease from the dynamic pool but it avoids // 20. The server allocates a new lease from the dynamic pool but it avoids
// allocating the address reserved for the Client B. // allocating the address reserved for the Client B.
// 20. Client B uses 4-way exchange to obtain a new lease. // 21. Client B uses 4-way exchange to obtain a new lease.
// 21. The server finally allocates a reserved address to the Client B. // 22. The server finally allocates a reserved address to the Client B.
TEST_F(DORATest, reservationsWithConflicts) { TEST_F(DORATest, reservationsWithConflicts) {
Dhcp4Client client(Dhcp4Client::SELECTING); Dhcp4Client client(Dhcp4Client::SELECTING);
// Configure DHCP server. // Configure DHCP server.
......
...@@ -123,6 +123,9 @@ TEST(IOAddressTest, isV4Zero) { ...@@ -123,6 +123,9 @@ TEST(IOAddressTest, isV4Zero) {
// 0.0.0.0 // 0.0.0.0
const IOAddress address_zero("0.0.0.0"); const IOAddress address_zero("0.0.0.0");
EXPECT_TRUE(address_zero.isV4Zero()); EXPECT_TRUE(address_zero.isV4Zero());
// :: (v6 zero address)
const IOAddress address_zero_v6("::");
EXPECT_FALSE(address_zero_v6.isV4Zero());
// 192.0.2.3 // 192.0.2.3
const IOAddress address_non_zero("192.0.2.3"); const IOAddress address_non_zero("192.0.2.3");
EXPECT_FALSE(address_non_zero.isV4Zero()); EXPECT_FALSE(address_non_zero.isV4Zero());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment