aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_wext.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-10-21 16:09:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-21 16:09:25 (GMT)
commit724950836f7c4499a226d3b6a81c7d26f66a0a3f (patch)
treec53ba3c917819e9e036ba8c752d4549455586ecb /src/drivers/driver_wext.c
parent48f8e036221db5355889ddf407b4552e5d89d2f7 (diff)
downloadhostap-724950836f7c4499a226d3b6a81c7d26f66a0a3f.zip
hostap-724950836f7c4499a226d3b6a81c7d26f66a0a3f.tar.gz
hostap-724950836f7c4499a226d3b6a81c7d26f66a0a3f.tar.bz2
wext: Clean up the disconnect BSSID/SSID clearing
Diffstat (limited to 'src/drivers/driver_wext.c')
-rw-r--r--src/drivers/driver_wext.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 27171d6..6f58175 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1840,31 +1840,36 @@ static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
}
if (iwr.u.mode == IW_MODE_INFRA) {
+ /* Clear the BSSID selection */
+ if (wpa_driver_wext_set_bssid(drv, null_bssid) < 0) {
+ wpa_printf(MSG_DEBUG, "WEXT: Failed to clear BSSID "
+ "selection on disconnect");
+ }
+
if (drv->cfg80211) {
/*
* cfg80211 supports SIOCSIWMLME commands, so there is
* no need for the random SSID hack, but clear the
- * BSSID and SSID.
+ * SSID.
*/
- if (wpa_driver_wext_set_bssid(drv, null_bssid) < 0 ||
- wpa_driver_wext_set_ssid(drv, (u8 *) "", 0) < 0) {
+ if (wpa_driver_wext_set_ssid(drv, (u8 *) "", 0) < 0) {
wpa_printf(MSG_DEBUG, "WEXT: Failed to clear "
- "to disconnect");
+ "SSID on disconnect");
}
return;
}
+
/*
- * Clear the BSSID selection and set a random SSID to make sure
- * the driver will not be trying to associate with something
- * even if it does not understand SIOCSIWMLME commands (or
- * tries to associate automatically after deauth/disassoc).
+ * Set a random SSID to make sure the driver will not be trying
+ * to associate with something even if it does not understand
+ * SIOCSIWMLME commands (or tries to associate automatically
+ * after deauth/disassoc).
*/
for (i = 0; i < 32; i++)
ssid[i] = rand() & 0xFF;
- if (wpa_driver_wext_set_bssid(drv, null_bssid) < 0 ||
- wpa_driver_wext_set_ssid(drv, ssid, 32) < 0) {
+ if (wpa_driver_wext_set_ssid(drv, ssid, 32) < 0) {
wpa_printf(MSG_DEBUG, "WEXT: Failed to set bogus "
- "BSSID/SSID to disconnect");
+ "SSID to disconnect");
}
}
}