iface-helper: accept new DHCP4 leases

The new lease must be accepted or the nettools client will not renew
it.
This commit is contained in:
Beniamino Galvani
2019-11-23 09:08:14 +01:00
parent 6cf1262ac5
commit ccfc3370af

View File

@@ -97,6 +97,7 @@ dhcp4_state_changed (NMDhcpClient *client,
static NMIP4Config *last_config = NULL;
NMIP4Config *existing;
gs_unref_ptrarray GPtrArray *ip4_dev_route_blacklist = NULL;
gs_free_error GError *error = NULL;
g_return_if_fail (!ip4_config || NM_IS_IP4_CONFIG (ip4_config));
@@ -122,6 +123,9 @@ dhcp4_state_changed (NMDhcpClient *client,
NM_IP_ROUTE_TABLE_SYNC_MODE_MAIN))
_LOGW (LOGD_DHCP4, "failed to apply DHCPv4 config");
if (!last_config && !nm_dhcp_client_accept (client, &error))
_LOGW (LOGD_DHCP4, "failed to accept lease: %s", error->message);
nm_platform_ip4_dev_route_blacklist_set (NM_PLATFORM_GET,
gl.ifindex,
ip4_dev_route_blacklist);