NetworkManager r3667 - in trunk: . src src/vpn-manager



Author: dcbw
Date: Wed May 14 02:56:01 2008
New Revision: 3667
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3667&view=rev

Log:
2008-05-13  Dan Williams  <dcbw redhat com>

	Fix refcounting issues over sleep/wake when a VPN connection was active that
	caused NM to try registering an object path for a device upon wake that was
	the same as an already registered object path.

	* src/nm-device.c
		- (nm_device_take_down): properly handle cases where the device is
			no longer active but was just active, and therefore must be
			deactivated.  When a device moves to unmanaged mode, this function
			previously would not deactivate the device, because the state was
			already unmanaged by the time this function was called.

	* src/vpn-manager/nm-vpn-connection.c
		- (device_state_changed): properly handle multiple devices states in
			which the device is now deactivated.  Code previously didn't handle
			transitions to the UNAVAILABLE (like rfkill or carrier off) and
			UNMANAGED states.



Modified:
   trunk/ChangeLog
   trunk/src/nm-device.c
   trunk/src/vpn-manager/nm-vpn-connection.c

Modified: trunk/src/nm-device.c
==============================================================================
--- trunk/src/nm-device.c	(original)
+++ trunk/src/nm-device.c	Wed May 14 02:56:01 2008
@@ -1470,12 +1470,9 @@
 void
 nm_device_take_down (NMDevice *self, gboolean wait)
 {
-	NMDeviceState state;
-
 	g_return_if_fail (NM_IS_DEVICE (self));
 
-	state = nm_device_get_state (self);
-	if ((state == NM_DEVICE_STATE_ACTIVATED) || nm_device_is_activating (self))
+	if (nm_device_get_act_request (self))
 		nm_device_interface_deactivate (NM_DEVICE_INTERFACE (self));
 
 	if (nm_device_is_up (self)) {

Modified: trunk/src/vpn-manager/nm-vpn-connection.c
==============================================================================
--- trunk/src/vpn-manager/nm-vpn-connection.c	(original)
+++ trunk/src/vpn-manager/nm-vpn-connection.c	Wed May 14 02:56:01 2008
@@ -179,7 +179,7 @@
 {
 	NMVPNConnection *connection = NM_VPN_CONNECTION (user_data);
 
-	if (state == NM_DEVICE_STATE_DISCONNECTED) {
+	if (state <= NM_DEVICE_STATE_DISCONNECTED) {
 		nm_vpn_connection_set_vpn_state (connection,
 		                                 NM_VPN_CONNECTION_STATE_DISCONNECTED,
 		                                 NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]