wext: Force disconnect on deauthenticate()
Use the same zero-BSSID, random-SSID trick for both disassociate() and deauthenticate().
This commit is contained in:
parent
b965fa7294
commit
4853d5ac84
1 changed files with 26 additions and 13 deletions
|
@ -1898,12 +1898,35 @@ static int wpa_driver_wext_mlme(struct wpa_driver_wext_data *drv,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv)
|
||||||
|
{
|
||||||
|
const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
|
||||||
|
u8 ssid[32];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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).
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int wpa_driver_wext_deauthenticate(void *priv, const u8 *addr,
|
static int wpa_driver_wext_deauthenticate(void *priv, const u8 *addr,
|
||||||
int reason_code)
|
int reason_code)
|
||||||
{
|
{
|
||||||
struct wpa_driver_wext_data *drv = priv;
|
struct wpa_driver_wext_data *drv = priv;
|
||||||
|
int ret;
|
||||||
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
|
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
|
||||||
return wpa_driver_wext_mlme(drv, addr, IW_MLME_DEAUTH, reason_code);
|
wpa_driver_wext_disconnect(drv);
|
||||||
|
ret = wpa_driver_wext_mlme(drv, addr, IW_MLME_DEAUTH, reason_code);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1911,20 +1934,10 @@ static int wpa_driver_wext_disassociate(void *priv, const u8 *addr,
|
||||||
int reason_code)
|
int reason_code)
|
||||||
{
|
{
|
||||||
struct wpa_driver_wext_data *drv = priv;
|
struct wpa_driver_wext_data *drv = priv;
|
||||||
const u8 null_bssid[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
|
int ret;
|
||||||
u8 ssid[32];
|
|
||||||
int ret, i;
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
|
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
|
||||||
|
|
||||||
ret = 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_disconnect(drv);
|
||||||
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue