Commit 5d7d819a authored by Dan Williams's avatar Dan Williams
Browse files

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

	* src/NetworkManagerPolicy.c
		- (nm_policy_activation_finish): Don't set NM_ACT_STAGE_ACTIVATED here, instead...
		- (nm_policy_schedule_activation_finish): Set NM_ACT_STAGE_ACTIVATED here to
			fix a situation where NM is told to terminate and the device stops activation,
			but the main thread isn't aware of that because it would never have run
			nm_policy_activation_finish() to set the ACTIVATED flag, because the main loop
			had already quit.

	* src/NetworkManagerDevice.c
		- (nm_device_probe_wired_link_state): cosmetic fixes
		- (nm_device_activate_stage5_ip_config_commit): Don't check link state if
			we've failed to activate or been canceled.
		- (nm_ac_test): nm_debug -> nm_info for "waiting for device to cancel" message


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@616 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 41e73a91
2005-05-08 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c
- (nm_policy_activation_finish): Don't set NM_ACT_STAGE_ACTIVATED here, instead...
- (nm_policy_schedule_activation_finish): Set NM_ACT_STAGE_ACTIVATED here to
fix a situation where NM is told to terminate and the device stops activation,
but the main thread isn't aware of that because it would never have run
nm_policy_activation_finish() to set the ACTIVATED flag, because the main loop
had already quit.
* src/NetworkManagerDevice.c
- (nm_device_probe_wired_link_state): cosmetic fixes
- (nm_device_activate_stage5_ip_config_commit): Don't check link state if
we've failed to activate or been canceled.
- (nm_ac_test): nm_debug -> nm_info for "waiting for device to cancel" message
2005-05-08 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerWireless.c
......
......@@ -847,17 +847,18 @@ static gboolean nm_device_probe_wired_link_state (NMDevice *dev)
/* Test devices have their link state set through DBUS */
if (dev->test_device)
return (nm_device_has_active_link (dev));
return nm_device_has_active_link (dev);
if (dev->removed)
return FALSE;
carrier_path = g_strdup_printf ("/sys/class/net/%s/carrier", dev->iface);
if (g_file_get_contents (carrier_path, &contents, &length, NULL)) {
if (g_file_get_contents (carrier_path, &contents, &length, NULL))
{
link = (gboolean) atoi (contents);
g_free (contents);
}
g_free(carrier_path);
g_free (carrier_path);
/* We say that non-carrier-detect devices always have a link, because
* they never get auto-selected by NM. User has to force them on us,
......@@ -2953,13 +2954,14 @@ static gboolean nm_device_activate_stage5_ip_config_commit (NMActRequest *req)
if ((tmp_ap = nm_ap_list_get_ap_by_essid (data->allowed_ap_list, nm_ap_get_essid (ap))))
nm_ap_set_auth_method (tmp_ap, nm_ap_get_auth_method (ap));
}
nm_policy_schedule_activation_finish (req);
nm_device_set_link_active (dev, nm_device_probe_link_state (dev));
}
else
nm_policy_schedule_activation_failed (req);
out:
nm_device_set_link_active (dev, nm_device_probe_link_state (dev));
nm_info ("Activation (%s) Stage 5 (IP Configure Commit) complete.", nm_device_get_iface (dev));
return FALSE;
}
......@@ -3054,7 +3056,7 @@ static gboolean nm_ac_test (int tries, nm_completion_args args)
if (nm_device_is_activating (dev))
{
if (tries % 20 == 0)
nm_debug ("Activation (%s/wireless): waiting on dhcp to cease or device to finish activation", nm_device_get_iface(dev));
nm_info ("Activation (%s): waiting for device to cancel activation.", nm_device_get_iface(dev));
return FALSE;
}
......
......@@ -73,9 +73,7 @@ gboolean nm_policy_activation_finish (NMActRequest *req)
nm_dbus_add_network_address (data->dbus_connection, NETWORK_TYPE_ALLOWED, nm_ap_get_essid (ap), &addr);
}
nm_act_request_set_stage (req, NM_ACT_STAGE_ACTIVATED);
nm_info ("Activation (%s) successful, device activated.", nm_device_get_iface (dev));
nm_schedule_state_change_signal_broadcast (data);
out:
......@@ -101,6 +99,8 @@ void nm_policy_schedule_activation_finish (NMActRequest *req)
dev = nm_act_request_get_dev (req);
g_assert (dev);
nm_act_request_set_stage (req, NM_ACT_STAGE_ACTIVATED);
source = g_idle_source_new ();
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
g_source_set_callback (source, (GSourceFunc) nm_policy_activation_finish, req, NULL);
......
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