aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-05-27 18:01:26 (GMT)
committerJouni Malinen <j@w1.fi>2009-05-27 18:01:26 (GMT)
commit2976121955ba0e2f52c09fbffc93f91dbf0d845b (patch)
tree8b4a897d38e1fb20c4b67fb8310138b078780a9e /src/drivers
parent87d01acfeb69f797bffae09b2c7f22e7c928998f (diff)
downloadhostap-2976121955ba0e2f52c09fbffc93f91dbf0d845b.zip
hostap-2976121955ba0e2f52c09fbffc93f91dbf0d845b.tar.gz
hostap-2976121955ba0e2f52c09fbffc93f91dbf0d845b.tar.bz2
wext: disconnect at init and deinit
To ensure the supplicant starts and ends with a clean slate (keys are already cleaned up at init and deinit time), force a null BSSID and bogus SSID to ensure the driver isn't connected to anything. Signed-off-by: Dan Williams <dcbw@redhat.com>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/driver_wext.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index b496712..ade8904 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -35,6 +35,7 @@
static int wpa_driver_wext_flush_pmkid(void *priv);
static int wpa_driver_wext_get_range(void *priv);
static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
+static void wpa_driver_wext_disconnect(struct wpa_driver_wext_data *drv);
static int wpa_driver_wext_send_oper_ifla(struct wpa_driver_wext_data *drv,
@@ -994,6 +995,13 @@ static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
wpa_driver_wext_get_range(drv);
+ /*
+ * Unlock the driver's BSSID and force to a random SSID to clear any
+ * previous association the driver might have when the supplicant
+ * starts up.
+ */
+ wpa_driver_wext_disconnect(drv);
+
drv->ifindex = if_nametoindex(drv->ifname);
if (os_strncmp(drv->ifname, "wlan", 4) == 0) {
@@ -1035,8 +1043,7 @@ void wpa_driver_wext_deinit(void *priv)
* Clear possibly configured driver parameters in order to make it
* easier to use the driver after wpa_supplicant has been terminated.
*/
- (void) wpa_driver_wext_set_bssid(drv,
- (u8 *) "\x00\x00\x00\x00\x00\x00");
+ wpa_driver_wext_disconnect(drv);
wpa_driver_wext_send_oper_ifla(priv, 0, IF_OPER_UP);