]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Clean up MLD changes that modified skipping DMG deauthentication
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 9 Oct 2024 16:46:23 +0000 (19:46 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 9 Oct 2024 16:46:23 +0000 (19:46 +0300)
Commit 05e5e615e6a2 ("AP: Skip authentication/deauthentication phase for
DMG/IEEE 802.11ad") added the check for DMG in the beginnign of
ap_sta_deauthenticate() to convert that call to ap_sta_disassociate()
since deauthentication is not used in DMG. Commit c6f519ff15b2 ("AP:
Support deauthenticate/disassociate with MLD") ended up moving this DMG
check into the ap_sta_handle_deauthenticate() function that gets called
once for each link. This is confusing even though DMG is not really used
in MLD.

Move the DMG check back to the beginning of ap_sta_deauthenticate() to
make this clearer.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/sta_info.c

index 13613dbab0d649d52cc74ba0fe15d24883321d4d..48ed3c03bea603fe232375303039aa896c48078e 100644 (file)
@@ -996,14 +996,6 @@ static void ap_sta_deauth_cb_timeout(void *eloop_ctx, void *timeout_ctx)
 static void ap_sta_handle_deauthenticate(struct hostapd_data *hapd,
                                         struct sta_info *sta, u16 reason)
 {
-       if (hapd->iface->current_mode &&
-           hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) {
-               /* Deauthentication is not used in DMG/IEEE 802.11ad;
-                * disassociate the STA instead. */
-               ap_sta_disassociate(hapd, sta, reason);
-               return;
-       }
-
        wpa_printf(MSG_DEBUG, "%s: deauthenticate STA " MACSTR,
                   hapd->conf->iface, MAC2STR(sta->addr));
 
@@ -1112,6 +1104,14 @@ void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
 void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
                           u16 reason)
 {
+       if (hapd->iface->current_mode &&
+           hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) {
+               /* Deauthentication is not used in DMG/IEEE 802.11ad;
+                * disassociate the STA instead. */
+               ap_sta_disassociate(hapd, sta, reason);
+               return;
+       }
+
        if (ap_sta_ml_disconnect(hapd, sta, reason, false))
                return;