While trying to establish a DUN connection with oFono,
an endless loop was found when requesting an IP block.
The problem was on data connection activation its address
with 32 length prefix was notified through ConnMann using
__connman_ippool_newaddr() but mask address shifting with
32 bits was obsolete. So IP pool was considerating block
0.0.0.0 to 255.255.255.255 was in use.
if (is_private_address(start) == FALSE)
return;
- mask = ~(0xffffffff >> prefixlen);
+ if (prefixlen >= 32)
+ mask = 0xffffffff;
+ else
+ mask = ~(0xffffffff >> prefixlen);
+
start = start & mask;
end = start | ~mask;