mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 00:10:07 +01:00
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:
parent
6cf1262ac5
commit
ccfc3370af
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue