From 49c1e0151900c2c3dea0ed8a8aab57bd91f28c5e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 18 Apr 2023 13:16:59 +0200 Subject: [PATCH] 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. --- src/core/devices/nm-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;