From: Karthik M Date: Thu, 11 Sep 2025 22:02:07 +0000 (+0530) Subject: Use a helper function to set SA Query timeout X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72b2772da9a1c59ee049b66b601791ad2cc0a234;p=thirdparty%2Fhostap.git Use a helper function to set SA Query timeout Introduce an ap_sta_set_sa_query_timeout() helper function to set the SA Query timeout state. This is in preparation for extending this functionality to cover MLD cases. Signed-off-by: Karthik M --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index ca5ca9687..e92faa527 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7040,7 +7040,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd, else mlme_associate_indication(hapd, sta); - sta->sa_query_timed_out = 0; + ap_sta_set_sa_query_timeout(hapd, sta, 0); if (sta->eapol_sm == NULL) { /* diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index dd0e3a7ac..e99d7cbeb 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -1432,6 +1432,13 @@ done: } +void ap_sta_set_sa_query_timeout(struct hostapd_data *hapd, + struct sta_info *sta, int value) +{ + sta->sa_query_timed_out = value; +} + + int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta) { u32 tu; @@ -1444,7 +1451,7 @@ int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta) HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_DEBUG, "association SA Query timed out"); - sta->sa_query_timed_out = 1; + ap_sta_set_sa_query_timeout(hapd, sta, 1); os_free(sta->sa_query_trans_id); sta->sa_query_trans_id = NULL; sta->sa_query_count = 0; diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index f963e8fd3..6ed2930dd 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -377,6 +377,8 @@ int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta, struct vlan_description *vlan_desc); void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta); void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta); +void ap_sta_set_sa_query_timeout(struct hostapd_data *hapd, + struct sta_info *sta, int value); int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta); const char * ap_sta_wpa_get_keyid(struct hostapd_data *hapd, struct sta_info *sta);