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:
@@ -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
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user