[PATCH v2] wext: really disassociate
Dan Williams
dcbw
Mon Feb 9 09:48:25 PST 2009
Really disassociate when tearing stuff down; drivers may sometimes
(legally) keep trying to reassociate unless the BSSID is unlocked. If
the SSID is unlocked too, under WEXT drivers are able to pick an SSID to
associate, so kill that behavior by setting a bogus SSID. Unfortunately
WEXT doesn't provide an easy method to say "stop whatever doing and just
idle".
Signed-off-by: Dan Williams <dcbw at redhat.com>
---
Until we know whether it's desirable to have MLME(deauth) do the same
thing, only force disassoc in MLME(disassoc).
v2: unconditionally clear locked BSSID and set bogus SSID
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 631c63d..c4deb53 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1911,9 +1911,22 @@ static int wpa_driver_wext_disassociate(void *priv, const u8 *addr,
int reason_code)
{
struct wpa_driver_wext_data *drv = priv;
+ const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
+ u8 ssid[32];
+ int ret, i;
+
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
- return wpa_driver_wext_mlme(drv, addr, IW_MLME_DISASSOC,
- reason_code);
+
+ ret = wpa_driver_wext_mlme(drv, addr, IW_MLME_DISASSOC,
+ reason_code);
+
+ wpa_driver_wext_set_bssid(drv, null_bssid);
+
+ for (i = 0; i < 32; i++)
+ ssid[i] = rand() & 0xFF;
+ wpa_driver_wext_set_ssid(drv, ssid, 32);
+
+ return ret;
}
More information about the Hostap
mailing list