2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +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
// not match.
return (IOAddress::IPV4_ZERO_ADDRESS());
return (pool_type_ == Lease::TYPE_V4 ? IOAddress::IPV4_ZERO_ADDRESS() : IOAddress::IPV6_ZERO_ADDRESS());
}
IOAddress

View File

@@ -334,7 +334,7 @@ TEST_F(RandomAllocatorTest6, clientClasses) {
// can't offer any address to the client.
cc_.clear();
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.