There is already code that checks if an IP address has been allocated inside the dynamic range (and if so, prevents creation of the range).
Currently, dynamic ranges cannot overlap other ranges, or reserved IP addresses. Reserved ranges can overlap reserved IP addresses, but not other ranges.
So I think the only thing to fix here is to verify that a user-reserved IP address is not within a dynamic range when reserving it.
(As an aside, if you wish to reserve an IP addresses inside a dynamic range, create a device first so that MAAS can add a DHCP mapping for the MAC to the reserved IP.)
There is already code that checks if an IP address has been allocated inside the dynamic range (and if so, prevents creation of the range).
Currently, dynamic ranges cannot overlap other ranges, or reserved IP addresses. Reserved ranges can overlap reserved IP addresses, but not other ranges.
So I think the only thing to fix here is to verify that a user-reserved IP address is not within a dynamic range when reserving it.
(As an aside, if you wish to reserve an IP addresses inside a dynamic range, create a device first so that MAAS can add a DHCP mapping for the MAC to the reserved IP.)