diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index a9e8c08508..35011a3db9 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -10880,7 +10880,16 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d case NM_DHCP_CLIENT_NOTIFY_TYPE_LEASE_UPDATE: if (!notify_data->lease_update.l3cd) { + const NML3ConfigData *dhcp_l3cd = priv->l3cds[L3_CONFIG_DATA_TYPE_DHCP_X(IS_IPv4)].d; + _LOGT_ipdhcp(addr_family, "lease lost"); + if (dhcp_l3cd + && nm_l3cfg_remove_config( + priv->l3cfg, + _dev_l3_config_data_tag_get(priv, L3_CONFIG_DATA_TYPE_DHCP_X(IS_IPv4)), + dhcp_l3cd)) { + _dev_l3_cfg_commit(self, FALSE); + } goto lease_update_out; } diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c index 4be03f4bab..8770656b73 100644 --- a/src/core/dhcp/nm-dhcp-client.c +++ b/src/core/dhcp/nm-dhcp-client.c @@ -899,6 +899,12 @@ _nm_dhcp_client_notify(NMDhcpClient *self, l3_cfg_notify_check_connected(self); + if (!priv->l3cd_curr) { + /* When the lease is lost, any cached ACD information is no longer relevant. + * Remove it so that it doesn't interfere with a new lease we might get. */ + _acd_state_reset(self, TRUE, TRUE); + } + _emit_notify(self, NM_DHCP_CLIENT_NOTIFY_TYPE_LEASE_UPDATE, .lease_update = {