From 53214901800ebcd1e1fabf98442983939af979bc Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 2 Jul 2020 17:38:10 +0200 Subject: [PATCH] device: restart DHCP only for devices that are active or activating do_sleep_wake() tries to restart DHCP for all devices, even ones that are disconnecting. When a device is disconnecting, it still has a DHCP client instance but we shouldn't restart it because it makes no sense; and especially, the device could be already removed. https://bugzilla.redhat.com/show_bug.cgi?id=1852612 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/561 (cherry picked from commit 2c50438987527a30d99c07601b8f1d1c9557cdaf) --- src/devices/nm-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 90178b68fe..a6c3e66803 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3822,6 +3822,10 @@ nm_device_update_dynamic_ip_setup (NMDevice *self) priv = NM_DEVICE_GET_PRIVATE (self); + if ( priv->state < NM_DEVICE_STATE_IP_CONFIG + || priv->state > NM_DEVICE_STATE_ACTIVATED) + return; + g_hash_table_remove_all (priv->ip6_saved_properties); if (priv->dhcp_data_4.client) {