mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-21 11:00:07 +01:00
core: kill PendingActivation and move authorization to NMActiveConnection
Besides killing PendingActivation, this patch decouples ActiveConnection creation from actually activating that connection. This allows the ActiveConnection to complete authorization asynchronously. This will also be used in the future for handling the DEACTIVATING state of devices (for "pre-down" functionality).
This commit is contained in:
parent
625008e486
commit
ff7e47a418
2 changed files with 473 additions and 549 deletions
868
src/nm-manager.c
868
src/nm-manager.c
File diff suppressed because it is too large
Load diff
|
|
@ -1232,6 +1232,7 @@ schedule_activate_check (NMPolicy *policy, NMDevice *device, guint delay_seconds
|
|||
{
|
||||
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
|
||||
ActivateData *data;
|
||||
const GSList *active_connections, *iter;
|
||||
|
||||
if (nm_manager_get_state (priv->manager) == NM_STATE_ASLEEP)
|
||||
return;
|
||||
|
|
@ -1245,6 +1246,15 @@ schedule_activate_check (NMPolicy *policy, NMDevice *device, guint delay_seconds
|
|||
if (!nm_device_autoconnect_allowed (device))
|
||||
return;
|
||||
|
||||
/* If the device already has an activation in-progress or waiting for
|
||||
* authentication, don't start an auto-activation for it.
|
||||
*/
|
||||
active_connections = nm_manager_get_active_connections (priv->manager);
|
||||
for (iter = active_connections; iter; iter = iter->next) {
|
||||
if (nm_active_connection_get_device (NM_ACTIVE_CONNECTION (iter->data)) == device)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Schedule an auto-activation if there isn't one already for this device */
|
||||
if (find_pending_activation (priv->pending_activation_checks, device) == NULL) {
|
||||
data = activate_data_new (policy, device, delay_seconds);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue