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:
1012
src/nm-manager.c
1012
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);
|
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
|
||||||
ActivateData *data;
|
ActivateData *data;
|
||||||
|
const GSList *active_connections, *iter;
|
||||||
|
|
||||||
if (nm_manager_get_state (priv->manager) == NM_STATE_ASLEEP)
|
if (nm_manager_get_state (priv->manager) == NM_STATE_ASLEEP)
|
||||||
return;
|
return;
|
||||||
@@ -1245,6 +1246,15 @@ schedule_activate_check (NMPolicy *policy, NMDevice *device, guint delay_seconds
|
|||||||
if (!nm_device_autoconnect_allowed (device))
|
if (!nm_device_autoconnect_allowed (device))
|
||||||
return;
|
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 */
|
/* Schedule an auto-activation if there isn't one already for this device */
|
||||||
if (find_pending_activation (priv->pending_activation_checks, device) == NULL) {
|
if (find_pending_activation (priv->pending_activation_checks, device) == NULL) {
|
||||||
data = activate_data_new (policy, device, delay_seconds);
|
data = activate_data_new (policy, device, delay_seconds);
|
||||||
|
Reference in New Issue
Block a user