[FIX] Allow IP allocation for arbitrary prefix length

Avoid using generators which lead to overflows