From b0be1285cceff5de2eef44a56abda6a98d51c91a 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) (cherry picked from commit 53214901800ebcd1e1fabf98442983939af979bc) (cherry picked from commit ef755588ad55261c6ade4ba0278d51d777022183) (cherry picked from commit da54b35af3b0a5120b4703060ee0b95cbc4fd0bd) --- 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 0a8f7ffc12..581df9becf 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3460,6 +3460,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->dhcp4.client) {