[PATCH] driver_wext.c: Make sure that interface is UP

Dmitry Shmidt dimitrysh
Mon Dec 7 13:04:44 PST 2009


Hi,

After association in case of key handshake we need to send packets and
we want xmit queue to be ON.
And sometimes it is possible that interface was turned OFF.

Thanks,

Dmitry

----------------------------------------------------------------------------------------
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 9d6a48d..b8c96b7 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -2086,7 +2086,7 @@ int wpa_driver_wext_associate(void *priv,
 	struct wpa_driver_wext_data *drv = priv;
 	int ret = 0;
 	int allow_unencrypted_eapol;
-	int value;
+	int value, flags;

 	wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);

@@ -2183,6 +2183,13 @@ int wpa_driver_wext_associate(void *priv,
 	    wpa_driver_wext_set_bssid(drv, params->bssid) < 0)
 		ret = -1;

+	/* Make sure that interface is UP */
+	if (!ret && (wpa_driver_wext_get_ifflags(drv, &flags) == 0)) {
+		if (!(flags & IFF_UP)) {
+			wpa_driver_wext_set_ifflags(drv, flags | IFF_UP);
+		}
+	}
+
 	return ret;
 }



More information about the Hostap mailing list