Commit 29aa287e authored by Dan Williams's avatar Dan Williams
Browse files

2005-08-22 Dan Williams <dcbw@redhat.com>

	Noticed by Bill Moss <bmoss@clemson.edu>
	* src/NetworkManagerDbus.c
		- (nm_dbus_get_user_key_for_network_cb): deactivate the device
			instead of just cancelling its activation

	* src/NetworkManagerDevice.c
		- (nm_device_deactivate): some small cleanups
		- (nm_device_set_user_key_for_network): deactivate the device
			instead of just cancelling its activation


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@898 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 6bad6d64
2005-08-22 Dan Williams <dcbw@redhat.com>
Noticed by Bill Moss <bmoss@clemson.edu>
* src/NetworkManagerDbus.c
- (nm_dbus_get_user_key_for_network_cb): deactivate the device
instead of just cancelling its activation
* src/NetworkManagerDevice.c
- (nm_device_deactivate): some small cleanups
- (nm_device_set_user_key_for_network): deactivate the device
instead of just cancelling its activation
2005-08-22 Dan Williams <dcbw@redhat.com>
Noticed by Bill Moss <bmoss@clemson.edu>
......
......@@ -453,20 +453,17 @@ static void nm_dbus_get_user_key_for_network_cb (DBusPendingCall *pcall, NMActRe
* to get the user key in exactly the same way, which ends up right back
* here... ad nauseum. Figure out how to deal with a failure here.
*/
if (nm_device_is_activating (dev))
nm_device_activation_cancel (dev);
nm_device_deactivate (dev);
nm_policy_schedule_device_change_check (data);
dbus_message_unref (reply);
goto out;
}
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &passphrase, DBUS_TYPE_INT32, &key_type, DBUS_TYPE_INVALID))
nm_device_set_user_key_for_network (req, passphrase, key_type);
else
{
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &passphrase, DBUS_TYPE_INT32, &key_type, DBUS_TYPE_INVALID))
nm_device_set_user_key_for_network (req, passphrase, key_type);
nm_act_request_set_user_key_pending_call (req, NULL);
}
dbus_message_unref (reply);
nm_act_request_set_user_key_pending_call (req, NULL);
out:
nm_act_request_unref (req);
dbus_pending_call_unref (pcall);
......
......@@ -3178,18 +3178,16 @@ gboolean nm_device_deactivate (NMDevice *dev)
nm_info ("Deactivating device %s.", nm_device_get_iface (dev));
if (dev->act_request)
{
/* Only send if the device is actually active */
if (nm_device_is_activated (dev))
nm_dbus_schedule_device_status_change_signal (dev->app_data, dev, NULL, DEVICE_NO_LONGER_ACTIVE);
}
if (nm_device_is_activating (dev))
else if (nm_device_is_activating (dev))
nm_device_activation_cancel (dev);
/* Tear down an existing activation request, which may not have happened
* in nm_device_activation_cancel() above, for various reasons.
*/
if (dev->act_request)
{
nm_dhcp_manager_cancel_transaction (dev->app_data->dhcp_manager, dev->act_request);
nm_act_request_unref (dev->act_request);
dev->act_request = NULL;
}
......@@ -3254,9 +3252,8 @@ void nm_device_set_user_key_for_network (NMActRequest *req, const char *key, con
if (strncmp (key, cancel_message, strlen (cancel_message)) == 0)
{
nm_ap_list_append_ap (data->invalid_ap_list, ap);
nm_device_deactivate (dev);
nm_policy_schedule_device_change_check (data);
if (req == nm_device_get_act_request (dev))
nm_device_schedule_activation_handle_cancel (req);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment