NetworkManager r3367 - in trunk: . src



Author: dcbw
Date: Fri Feb 29 16:58:55 2008
New Revision: 3367
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3367&view=rev

Log:
2008-02-29  Dan Williams  <dcbw redhat com>

	* src/nm-device-802-11-wireless.c
		- (link_timeout_cb): try again if scanning; deactivate the device when
			activated if the link dies
		- (supplicant_iface_connection_state_cb_handler): bump link timeout to
			15 seconds



Modified:
   trunk/ChangeLog
   trunk/src/nm-device-802-11-wireless.c

Modified: trunk/src/nm-device-802-11-wireless.c
==============================================================================
--- trunk/src/nm-device-802-11-wireless.c	(original)
+++ trunk/src/nm-device-802-11-wireless.c	Fri Feb 29 16:58:55 2008
@@ -1855,7 +1855,8 @@
 link_timeout_cb (gpointer user_data)
 {
 	NMDevice *              dev = NM_DEVICE (user_data);
-	NMDevice80211Wireless * self = NM_DEVICE_802_11_WIRELESS (user_data);	
+	NMDevice80211Wireless * self = NM_DEVICE_802_11_WIRELESS (dev);
+	NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
 	NMActRequest *          req = NULL;
 	NMAccessPoint *         ap = NULL;
 	NMConnection *          connection;
@@ -1864,8 +1865,11 @@
 
 	g_assert (dev);
 
-	if (self->priv->link_timeout_id)
-		self->priv->link_timeout_id = 0;
+	/* If currently scanning and disconnected still, check again later. */
+	if (priv->scanning)
+		return TRUE;
+
+	priv->link_timeout_id = 0;
 
 	req = nm_device_get_act_request (dev);
 	ap = nm_device_802_11_wireless_get_activation_ap (self);
@@ -1879,6 +1883,15 @@
 		return FALSE;
 	}
 
+	/* Disconnect event while activated; the supplicant hasn't been able
+	 * to reassociate within the timeout period, so the connection must
+	 * fail.
+	 */
+	if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) {
+		nm_device_interface_deactivate (NM_DEVICE_INTERFACE (dev));
+		return FALSE;
+	}
+
 	/* Disconnect event during initial authentication and credentials
 	 * ARE checked - we are likely to have wrong key.  Ask the user for
 	 * another one.
@@ -2048,8 +2061,8 @@
 	} else if (new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) {
 		if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED || nm_device_is_activating (dev)) {
 			/* Start the link timeout so we allow some time for reauthentication */
-			if ((self->priv->link_timeout_id == 0) && !self->priv->scanning)
-				self->priv->link_timeout_id = g_timeout_add (12000, link_timeout_cb, self);
+			if (!self->priv->link_timeout_id)
+				self->priv->link_timeout_id = g_timeout_add (15000, link_timeout_cb, self);
 		} else {
 			nm_device_set_active_link (dev, FALSE);
 		}



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