M #-: Deal with Address Range resize to 0

(cherry picked from commit e8f1a7641cf36831bf5426b1d2f17120ab893d2a)
This commit is contained in:
Ruben S. Montero committed 2021-08-31 19:06:16 +02:00
1 parent 50b1504a79
commit b3aeef43df
1 file changed
+12 -1
+12 -1
View File
@@ -446,7 +446,18 @@ int AddressRange::update_attributes(
return -1;
}
if (allocated.upper_bound(new_size-1) != allocated.end())
std::map<unsigned int, long long>::iterator it;
if ( new_size == 0 )
{
it = allocated.find(0);
}
else
{
it = allocated.upper_bound(new_size - 1);
}
if (it != allocated.end())
{
error_msg = "New SIZE cannot be applied. There are used leases"
" that would fall outside the range.";