2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 15:05:16 +00:00

[#2843] Fix in random allocator return values

This commit is contained in:
Marcin Siodelski
2023-05-12 14:45:35 +02:00
parent 01ded4bedb
commit 5a660f5b79
2 changed files with 2 additions and 2 deletions

View File

@@ -80,7 +80,7 @@ RandomAllocator::pickAddressInternal(const ClientClasses& client_classes,
// No pool available. There are no pools or client classes do // No pool available. There are no pools or client classes do
// not match. // not match.
return (IOAddress::IPV4_ZERO_ADDRESS()); return (pool_type_ == Lease::TYPE_V4 ? IOAddress::IPV4_ZERO_ADDRESS() : IOAddress::IPV6_ZERO_ADDRESS());
} }
IOAddress IOAddress

View File

@@ -334,7 +334,7 @@ TEST_F(RandomAllocatorTest6, clientClasses) {
// can't offer any address to the client. // can't offer any address to the client.
cc_.clear(); cc_.clear();
IOAddress candidate = alloc.pickAddress(cc_, duid_, IOAddress("0.0.0.0")); IOAddress candidate = alloc.pickAddress(cc_, duid_, IOAddress("0.0.0.0"));
EXPECT_TRUE(candidate.isV4Zero()); EXPECT_TRUE(candidate.isV6Zero());
} }
// Test allocating delegated prefixes when a subnet has a single pool. // Test allocating delegated prefixes when a subnet has a single pool.