sme: Check for prev_bssid from sme_event_disassoc
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 18 Aug 2010 18:23:26 +0000 (21:23 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 18 Aug 2010 18:23:26 +0000 (21:23 +0300)
wpa_s->bssid is already cleared by mark_disassoc() when we're getting the
disassociation event for the case where wpa_supplicant requested
disassociation. wpa_s->sme.prev_bssid holds the BSSID we need to check
for, so use that instead.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
wpa_supplicant/sme.c

index 7cf3cc1..5604e97 100644 (file)
@@ -474,7 +474,7 @@ void sme_event_disassoc(struct wpa_supplicant *wpa_s,
                        union wpa_event_data *data)
 {
        wpa_printf(MSG_DEBUG, "SME: Disassociation event received");
-       if (!is_zero_ether_addr(wpa_s->bssid) &&
+       if (wpa_s->sme.prev_bssid_set &&
            !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME)) {
                /*
                 * cfg80211/mac80211 can get into somewhat confused state if
@@ -484,7 +484,7 @@ void sme_event_disassoc(struct wpa_supplicant *wpa_s,
                 */
                wpa_printf(MSG_DEBUG, "SME: Deauthenticate to clear driver "
                           "state");
-               wpa_drv_deauthenticate(wpa_s, wpa_s->bssid,
+               wpa_drv_deauthenticate(wpa_s, wpa_s->sme.prev_bssid,
                                       WLAN_REASON_DEAUTH_LEAVING);
        }
 }