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.
This commit is contained in:
Thomas Haller 2023-04-18 13:16:59 +02:00
parent e66b93b01e
commit 49c1e01519
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;