struct ieee802_11_elems elems;
u8 buf[IEEE80211_MAX_MMPDU_SIZE], *p = buf;
int new_assoc;
+ bool updated;
wpa_printf(MSG_DEBUG, "%s FILS: Finish association with " MACSTR,
__func__, MAC2STR(sta->addr));
sta->fils_pending_assoc_is_reassoc,
WLAN_STATUS_SUCCESS,
buf, p - buf);
- ap_sta_set_authorized(hapd, sta, 1);
+ updated = ap_sta_set_authorized_flag(hapd, sta, 1);
new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
hostapd_set_sta_flags(hapd, sta);
+ if (updated)
+ ap_sta_set_authorized_event(hapd, sta, 1);
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FILS);
ieee802_1x_notify_port_enabled(sta->eapol_sm, 1);
hostapd_new_assoc_sta(hapd, sta, !new_assoc);
#ifdef CONFIG_OWE
struct hostapd_iface *iface = hapd->iface;
#endif /* CONFIG_OWE */
+ bool updated = false;
if (addr == NULL) {
/*
sta->auth_alg == WLAN_AUTH_FILS_SK ||
sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
sta->auth_alg == WLAN_AUTH_FILS_PK)
- ap_sta_set_authorized(hapd, sta, 1);
+ updated = ap_sta_set_authorized_flag(hapd, sta, 1);
#else /* CONFIG_IEEE80211R_AP || CONFIG_FILS */
/* Keep compiler silent about unused variables */
if (status) {
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
hostapd_set_sta_flags(hapd, sta);
+ if (updated)
+ ap_sta_set_authorized_event(hapd, sta, 1);
if (reassoc && (sta->auth_alg == WLAN_AUTH_FT))
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT);
struct mld_link_info *link,
bool ok)
{
+ bool updated = false;
+
if (!ok) {
hostapd_logger(hapd, link->peer_addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
if (!hapd->conf->ieee802_1x && !hapd->conf->wpa)
- ap_sta_set_authorized(hapd, sta, 1);
+ updated = ap_sta_set_authorized_flag(hapd, sta, 1);
hostapd_set_sta_flags(hapd, sta);
+ if (updated)
+ ap_sta_set_authorized_event(hapd, sta, 1);
/*
* TODOs:
bool authorized, bool mld)
{
int res;
+ bool update;
if (sta->flags & WLAN_STA_PREAUTH)
return;
- ap_sta_set_authorized(hapd, sta, authorized);
+ update = ap_sta_set_authorized_flag(hapd, sta, authorized);
res = hostapd_set_authorized(hapd, sta, authorized);
+ if (update)
+ ap_sta_set_authorized_event(hapd, sta, authorized);
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
HOSTAPD_LEVEL_DEBUG, "%sauthorizing port",
authorized ? "" : "un");
}
-void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
- int authorized)
+bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta,
+ int authorized)
{
- const u8 *dev_addr = NULL;
- char buf[100];
-#ifdef CONFIG_P2P
- u8 addr[ETH_ALEN];
- u8 ip_addr_buf[4];
-#endif /* CONFIG_P2P */
-
if (!!authorized == !!(sta->flags & WLAN_STA_AUTHORIZED))
- return;
+ return false;
if (authorized) {
int mld_assoc_link_id = -1;
sta->flags &= ~WLAN_STA_AUTHORIZED;
}
+ return true;
+}
+
+
+void ap_sta_set_authorized_event(struct hostapd_data *hapd,
+ struct sta_info *sta, int authorized)
+{
+ const u8 *dev_addr = NULL;
+ char buf[100];
+#ifdef CONFIG_P2P
+ u8 addr[ETH_ALEN];
+ u8 ip_addr_buf[4];
+#endif /* CONFIG_P2P */
+
#ifdef CONFIG_P2P
if (hapd->p2p_group == NULL) {
if (sta->p2p_ie != NULL &&
}
+void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+ int authorized)
+{
+ if (!ap_sta_set_authorized_flag(hapd, sta, authorized))
+ return;
+ ap_sta_set_authorized_event(hapd, sta, authorized);
+}
+
+
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *addr, u16 reason)
{
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *addr, u16 reason);
+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,
struct sta_info *sta, int authorized);
static inline int ap_sta_is_authorized(struct sta_info *sta)