manager: merge branch 'wl/device_auth_request_fix'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1716
This commit is contained in:
Fernando Fernandez Mancera
2023-08-23 16:00:43 +02:00
2 changed files with 23 additions and 9 deletions

View File

@@ -3222,6 +3222,13 @@ device_auth_done_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointer
nm_assert(error || (result == NM_AUTH_CALL_RESULT_YES));
}
if (!error && !nm_dbus_object_is_exported(NM_DBUS_OBJECT(device))) {
g_set_error(&error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
"device no longer exists");
}
callback(device, context, subject, error, nm_auth_chain_get_data(chain, "user-data"));
}
@@ -3287,6 +3294,14 @@ nm_manager_device_auth_request(NMManager *self,
&error))
goto fail_on_idle;
if (!nm_dbus_object_is_exported(NM_DBUS_OBJECT(device))) {
g_set_error(&error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
"device no longer exists");
goto fail_on_idle;
}
chain = nm_auth_chain_new_subject(subject, context, device_auth_done_cb, self);
if (cancellable)
nm_auth_chain_set_cancellable(chain, cancellable);

View File

@@ -1662,15 +1662,14 @@ nm_policy_device_recheck_auto_activate_schedule(NMPolicy *self, NMDevice *device
g_return_if_fail(NM_IS_POLICY(self));
g_return_if_fail(NM_IS_DEVICE(device));
if (g_signal_handler_find(device,
G_SIGNAL_MATCH_DATA,
0,
0,
NULL,
NULL,
NM_POLICY_GET_PRIVATE(self))
== 0)
return;
nm_assert(g_signal_handler_find(device,
G_SIGNAL_MATCH_DATA,
0,
0,
NULL,
NULL,
NM_POLICY_GET_PRIVATE(self))
!= 0);
if (!c_list_is_empty(&device->policy_auto_activate_lst)) {
/* already queued. Return. */