diff options
author | Thomas Haller <thaller@redhat.com> | 2023-04-18 13:16:59 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-04-27 08:35:27 +0200 |
commit | 49c1e0151900c2c3dea0ed8a8aab57bd91f28c5e (patch) | |
tree | fbef992ac7eb222d46398ccce6da8af5d4e79d0a | |
parent | e66b93b01e23a57090550b28eb5e34c88886fcbd (diff) | |
download | NetworkManager-49c1e0151900c2c3dea0ed8a8aab57bd91f28c5e.tar.gz |
core: don't trigger recheck to auto activate for deleted devices
The delete_on_deactivate_link_delete() handler may be called after the
device was already removed from NMManager. Don't allow that.
Check whether the device is still exported on D-Bus as indication.
-rw-r--r-- | src/core/devices/nm-device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index c69bb44804..6edc74b3f2 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -12788,7 +12788,11 @@ delete_on_deactivate_link_delete(gpointer user_data) if (!nm_device_unrealize(self, TRUE, &error)) _LOGD(LOGD_DEVICE, "delete_on_deactivate: unrealizing failed (%s)", error->message); - nm_device_emit_recheck_auto_activate(self); + if (nm_dbus_object_is_exported(NM_DBUS_OBJECT(self))) { + /* The device is still alive. We may need to autoactivate virtual + * devices again. */ + nm_device_emit_recheck_auto_activate(self); + } g_free(data); return FALSE; |