summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-07-02 17:38:10 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-07-02 18:07:58 +0200
commit1b4ce31a1bf71a1b2ac93933d0d72d162e348996 (patch)
tree96eaed2a14fce8472b9734ee68a21804e3079399
parent76baf6e0ba16fafcb1d311395dfa8670dab07cc3 (diff)
downloadNetworkManager-bg/rh1852612.tar.gz
device: restart DHCP only for devices that are active or activatingbg/rh1852612
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
-rw-r--r--src/devices/nm-device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 0f0829ea4a..9b080817cd 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3824,6 +3824,10 @@ nm_device_update_dynamic_ip_setup (NMDevice *self)
g_hash_table_remove_all (priv->ip6_saved_properties);
+ if ( priv->state < NM_DEVICE_STATE_IP_CONFIG
+ || priv->state > NM_DEVICE_STATE_ACTIVATED)
+ return;
+
if (priv->dhcp_data_4.client) {
if (!nm_device_dhcp4_renew (self, FALSE)) {
nm_device_state_changed (self,