dhcp/nettools: normalize subnet netmask in nettools client
For an IPv4 subnet mask we expect that all the leading bits are set (no "holes"). But _nm_utils_ip4_netmask_to_prefix() does not enforce that, and tries to make the best of it. In face of a netmask with holes, normalize the mask.
This commit is contained in:
@@ -254,7 +254,8 @@ lease_parse_address(NDhcp4ClientLease *lease,
|
||||
"could not get netmask from lease");
|
||||
return FALSE;
|
||||
}
|
||||
a_plen = _nm_utils_ip4_netmask_to_prefix(a_netmask);
|
||||
a_plen = _nm_utils_ip4_netmask_to_prefix(a_netmask);
|
||||
a_netmask = _nm_utils_ip4_prefix_to_netmask(a_plen);
|
||||
}
|
||||
|
||||
nm_dhcp_option_add_option_in_addr(options,
|
||||
|
Reference in New Issue
Block a user