2007-09-26 Dan Williams <dcbw@redhat.com>
* src/nm-manager.c src/nm-manager.h src/nm-activation-request.c src/nm-activation-request.h - Move the GetSecrets stuff out of the NMManager instance because it doesn't really need to be there and complicates things * src/nm-device.c - (connection_secrets_failed_cb, device_activation_go): connect to the connection-secrets-failed signal and deactivate the device if the GetSecrets call fails * src/nm-device-802-11-wireless.c - (link_timeout_cb, supplicant_connection_timeout_cb, real_act_stage2_config, real_act_stage4_ip_config_timeout): request secrets and give correct hints about whether new secrets should be asked for by the client or not git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2899 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -73,6 +73,7 @@ struct _NMDevicePrivate
|
||||
gulong act_deferred_start_id;
|
||||
guint act_source_id;
|
||||
gulong secrets_updated_id;
|
||||
gulong secrets_failed_id;
|
||||
|
||||
/* IP configuration info */
|
||||
void * system_config_data; /* Distro-specific config data (parsed config file, etc) */
|
||||
@@ -977,6 +978,12 @@ clear_act_request (NMDevice *self)
|
||||
priv->secrets_updated_id = 0;
|
||||
}
|
||||
|
||||
if (priv->secrets_failed_id) {
|
||||
g_signal_handler_disconnect (priv->act_request,
|
||||
priv->secrets_failed_id);
|
||||
priv->secrets_failed_id = 0;
|
||||
}
|
||||
|
||||
g_object_unref (priv->act_request);
|
||||
priv->act_request = NULL;
|
||||
}
|
||||
@@ -1114,6 +1121,17 @@ connection_secrets_updated_cb (NMActRequest *req,
|
||||
NM_DEVICE_GET_CLASS (self)->connection_secrets_updated (self, connection, setting_name);
|
||||
}
|
||||
|
||||
static void
|
||||
connection_secrets_failed_cb (NMActRequest *req,
|
||||
NMConnection *connection,
|
||||
const char *setting_name,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDevice *self = NM_DEVICE (user_data);
|
||||
|
||||
nm_device_interface_deactivate (NM_DEVICE_INTERFACE (self));
|
||||
}
|
||||
|
||||
static void
|
||||
deferred_activation_timeout_cb (NMActRequest *req, gpointer user_data)
|
||||
{
|
||||
@@ -1168,6 +1186,12 @@ device_activation_go (NMDevice *self)
|
||||
self);
|
||||
priv->secrets_updated_id = id;
|
||||
|
||||
id = g_signal_connect (priv->act_request,
|
||||
"connection-secrets-failed",
|
||||
G_CALLBACK (connection_secrets_failed_cb),
|
||||
self);
|
||||
priv->secrets_failed_id = id;
|
||||
|
||||
/* HACK: update the state a bit early to avoid a race between the
|
||||
* scheduled stage1 handler and nm_policy_device_change_check() thinking
|
||||
* that the activation request isn't deferred because the deferred bit
|
||||
|
Reference in New Issue
Block a user