[PATCH 02/42] sme: Drop old disassoc_while_authenticating workaround
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Mon Nov 20 15:51:16 PST 2023
From: Benjamin Berg <benjamin.berg at intel.com>
This workaround pre-dates the code that supresses the deauth or
disconnect event from nl80211. Should this code be called it would not
actually work at this point, as important internal state for the
authentication attempt has already been lost.
Simply drop the code. This might also fix issues where we could get
into a bad state if a proper deauth/disconnect event happens while we
are authenticating or associating.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
wpa_supplicant/events.c | 9 ---------
wpa_supplicant/sme.c | 22 ----------------------
wpa_supplicant/sme.h | 8 --------
3 files changed, 39 deletions(-)
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0e5b6c6a86..1ee6eb82ed 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4133,14 +4133,11 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
int locally_generated)
{
const u8 *bssid;
- int authenticating;
u8 prev_pending_bssid[ETH_ALEN];
struct wpa_bss *fast_reconnect = NULL;
struct wpa_ssid *fast_reconnect_ssid = NULL;
- struct wpa_ssid *last_ssid;
struct wpa_bss *curr = NULL;
- authenticating = wpa_s->wpa_state == WPA_AUTHENTICATING;
os_memcpy(prev_pending_bssid, wpa_s->pending_bssid, ETH_ALEN);
if (wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE) {
@@ -4236,17 +4233,11 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG, "Disconnect event - remove keys");
wpa_clear_keys(wpa_s, wpa_s->bssid);
}
- last_ssid = wpa_s->current_ssid;
wpa_supplicant_mark_disassoc(wpa_s);
if (curr)
wpa_bss_remove(wpa_s, curr, "Connection to AP lost");
- if (authenticating && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)) {
- sme_disassoc_while_authenticating(wpa_s, prev_pending_bssid);
- wpa_s->current_ssid = last_ssid;
- }
-
if (fast_reconnect &&
!wpas_network_disabled(wpa_s, fast_reconnect_ssid) &&
!disallowed_bssid(wpa_s, fast_reconnect->bssid) &&
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 5faa038690..8c81824f09 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -2888,28 +2888,6 @@ void sme_state_changed(struct wpa_supplicant *wpa_s)
}
-void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
- const u8 *prev_pending_bssid)
-{
- /*
- * mac80211-workaround to force deauth on failed auth cmd,
- * requires us to remain in authenticating state to allow the
- * second authentication attempt to be continued properly.
- */
- wpa_dbg(wpa_s, MSG_DEBUG, "SME: Allow pending authentication "
- "to proceed after disconnection event");
- wpa_supplicant_set_state(wpa_s, WPA_AUTHENTICATING);
- os_memcpy(wpa_s->pending_bssid, prev_pending_bssid, ETH_ALEN);
-
- /*
- * Re-arm authentication timer in case auth fails for whatever reason.
- */
- eloop_cancel_timeout(sme_auth_timer, wpa_s, NULL);
- eloop_register_timeout(SME_AUTH_TIMEOUT, 0, sme_auth_timer, wpa_s,
- NULL);
-}
-
-
void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s)
{
wpa_s->sme.prev_bssid_set = 0;
diff --git a/wpa_supplicant/sme.h b/wpa_supplicant/sme.h
index c797d2e9e7..50524d1318 100644
--- a/wpa_supplicant/sme.h
+++ b/wpa_supplicant/sme.h
@@ -32,8 +32,6 @@ void sme_event_ch_switch(struct wpa_supplicant *wpa_s);
void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa,
const u8 *data, size_t len);
void sme_state_changed(struct wpa_supplicant *wpa_s);
-void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
- const u8 *prev_pending_bssid);
void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s);
void sme_deinit(struct wpa_supplicant *wpa_s);
@@ -98,12 +96,6 @@ static inline void sme_state_changed(struct wpa_supplicant *wpa_s)
{
}
-static inline void
-sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
- const u8 *prev_pending_bssid)
-{
-}
-
static inline void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s)
{
}
--
2.38.1
More information about the Hostap
mailing list