The prefix is being stored as a total number of bits now since it is
easier for any bitwise maths later. This is however causing an incorrect
prefix being computed when splitting a network into two subnets for
IPv4.
To get the correct prefix, loc_network_prefix must be called.
Introduced in
1fd09d0b09756649968fec42c737c88b92e4f11f
Reported-by: Valter Jansons <valter.jansons@gmail.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
*subnet2 = NULL;
// New prefix length
- unsigned int prefix = network->prefix + 1;
+ unsigned int prefix = loc_network_prefix(network) + 1;
// Check if the new prefix is valid
if (!loc_address_valid_prefix(&network->first_address, prefix)) {