diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/nm-device.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 5ea94c7959..81e8d934f9 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7787,8 +7787,8 @@ dhcp4_dad_cb (NMDevice *self, NMIP4Config **configs, gboolean success) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); if (success) { - nm_dhcp_client_accept (priv->dhcp4.client, NULL); - nm_device_activate_schedule_ip_config_result (self, AF_INET, NM_IP_CONFIG_CAST (configs[1])); + nm_device_activate_schedule_ip_config_result (self, AF_INET, + NM_IP_CONFIG_CAST (configs[1])); } else { nm_dhcp_client_decline (priv->dhcp4.client, "Address conflict detected", NULL); nm_device_ip_method_failed (self, AF_INET, @@ -10774,6 +10774,18 @@ activate_stage5_ip_config_result_4 (NMDevice *self) } } + if (priv->dhcp4.client) { + gs_free_error GError *error = NULL; + + if (!nm_dhcp_client_accept (priv->dhcp4.client, &error)) { + _LOGW (LOGD_DHCP4, + "Activation: Stage 5 of 5 (IPv4 Commit) error accepting lease: %s", + error->message); + nm_device_ip_method_failed (self, AF_INET, NM_DEVICE_STATE_REASON_DHCP_ERROR); + return; + } + } + /* If IPv4 wasn't the first to complete, and DHCP was used, then ensure * dispatcher scripts get the DHCP lease information. */ |