Commit 84dbc217 authored by Francesco Giudici's avatar Francesco Giudici

dhcp: nettools: check if addr is in the lease when bound

otherwise quit early and share log info about it, like we do in the
systemd internal client.
parent 2509b840
Pipeline #51143 failed with stages
in 64 minutes and 11 seconds
......@@ -374,6 +374,12 @@ lease_parse_address (NDhcp4ClientLease *lease,
guint64 a_lifetime;
n_dhcp4_client_lease_get_yiaddr (lease, &a_address);
if (a_address.s_addr == INADDR_ANY) {
nm_utils_error_set_literal (error, NM_UTILS_ERROR_UNKNOWN, "could not get address from lease");
return FALSE;
/* n_dhcp4_client_lease_get_lifetime() never fails */
n_dhcp4_client_lease_get_lifetime (lease, &a_lifetime);
if (!lease_get_in_addr (lease, NM_DHCP_OPTION_DHCP4_SUBNET_MASK, &a_netmask)) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment