mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 03:20:18 +01:00
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:
parent
57dfa999f7
commit
c06e6390a4
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue