]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update STA authorized flag for AP SME in driver cases for open network
authorJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 21:04:51 +0000 (23:04 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 21:04:51 +0000 (23:04 +0200)
With AP SME in hostapd/wpa_supplicant, TX status handler for
(Re)Association Response frame takes care of this, but with AP SME in
driver cases, ap_sta_set_authorized(1) is not sufficient to update the
driver flags for the STA, so cover that case as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c
src/ap/sta_info.c
src/ap/sta_info.h

index 58f93e28b0428227f48d37ca613767ed021b4211..5d8df780069ad772efa2ab246df6124bb4cc4334 100644 (file)
@@ -4108,7 +4108,13 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
         * IEEE 802.1X/WPA code will start accounting after the station has
         * been authorized. */
        if (!hapd->conf->ieee802_1x && !hapd->conf->wpa && !hapd->conf->osen) {
-               ap_sta_set_authorized(hapd, sta, 1);
+               if (ap_sta_set_authorized(hapd, sta, 1)) {
+                       /* Update driver authorized flag for the STA to cover
+                        * the case where AP SME is in the driver and there is
+                        * no separate event for handling TX status event for
+                        * the (Re)Association Response frame. */
+                       hostapd_set_sta_flags(hapd, sta);
+               }
                os_get_reltime(&sta->connected_time);
                accounting_sta_start(hapd, sta);
        }
index 9c39b1cc66735ca91e3d011e24c2106f2113d6a4..5a7677905d655d6fd0284afa1400cc8a302380c3 100644 (file)
@@ -1658,12 +1658,13 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
 }
 
 
-void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+bool ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
                           int authorized)
 {
        if (!ap_sta_set_authorized_flag(hapd, sta, authorized))
-               return;
+               return false;
        ap_sta_set_authorized_event(hapd, sta, authorized);
+       return true;
 }
 
 
index 2cd456bbbdaa0b5b6c4f224a291a2071248e3019..d22e86d451d48a88793648918af616d4a27f3649 100644 (file)
@@ -386,7 +386,7 @@ bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta,
                                int authorized);
 void ap_sta_set_authorized_event(struct hostapd_data *hapd,
                                 struct sta_info *sta, int authorized);
-void ap_sta_set_authorized(struct hostapd_data *hapd,
+bool ap_sta_set_authorized(struct hostapd_data *hapd,
                           struct sta_info *sta, int authorized);
 static inline int ap_sta_is_authorized(struct sta_info *sta)
 {