[PATCH] wnm_ap: optional disassociation for bss_tm_req

Nils Hendrik Rottgardt n.rottgardt at gmail.com
Sat Nov 30 13:20:17 PST 2024


To give controllers like usteer or DAWN the opportunity to disassociate
with the right reason code and also avoid a disassociation if it is
not neccessary.

Signed-off-by: Nils Hendrik Rottgardt <n.rottgardt at gmail.com>
---
 src/ap/wnm_ap.c | 13 ++++++++++++-
 src/ap/wnm_ap.h |  5 +++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
index af8cccaef..d4770c072 100644
--- a/src/ap/wnm_ap.c
+++ b/src/ap/wnm_ap.c
@@ -961,6 +961,16 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
 			const u8 *bss_term_dur, u8 dialog_token,
 			const char *url, const u8 *nei_rep, size_t nei_rep_len,
 			const u8 *mbo_attrs, size_t mbo_len)
+{
+	return wnm_send_bss_tm_req_disassoc(hapd, sta, req_mode, disassoc_timer, valid_int, bss_term_dur, dialog_token, url, nei_rep, nei_rep_len, mbo_attrs, mbo_len, true);
+}
+
+
+int wnm_send_bss_tm_req_disassoc(struct hostapd_data *hapd, struct sta_info *sta,
+                                 u8 req_mode, int disassoc_timer, u8 valid_int,
+                                 const u8 *bss_term_dur, u8 dialog_token,
+                                 const char *url, const u8 *nei_rep, size_t nei_rep_len,
+                                 const u8 *mbo_attrs, size_t mbo_len, bool disassoc)
 {
 	u8 *buf, *pos;
 	struct ieee80211_mgmt *mgmt;
@@ -1050,7 +1060,8 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
 #endif /* CONFIG_IEEE80211BE */
 
 		/* send disassociation frame after time-out */
-		set_disassoc_timer(hapd, sta, disassoc_timer);
+		if (disassoc)
+			set_disassoc_timer(hapd, sta, disassoc_timer);
 	}
 
 	return 0;
diff --git a/src/ap/wnm_ap.h b/src/ap/wnm_ap.h
index f86c6b2af..4e0aa1f9e 100644
--- a/src/ap/wnm_ap.h
+++ b/src/ap/wnm_ap.h
@@ -23,6 +23,11 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
 			const u8 *bss_term_dur, u8 dialog_token,
 			const char *url, const u8 *nei_rep, size_t nei_rep_len,
 			const u8 *mbo_attrs, size_t mbo_len);
+int wnm_send_bss_tm_req_disassoc(struct hostapd_data *hapd, struct sta_info *sta,
+			u8 req_mode, int disassoc_timer, u8 valid_int,
+			const u8 *bss_term_dur, u8 dialog_token,
+			const char *url, const u8 *nei_rep, size_t nei_rep_len,
+			const u8 *mbo_attrs, size_t mbo_len, bool disassoc);
 void ap_sta_reset_steer_flag_timer(void *eloop_ctx, void *timeout_ctx);
 int wnm_send_coloc_intf_req(struct hostapd_data *hapd, struct sta_info *sta,
 			    unsigned int auto_report, unsigned int timeout);
-- 
2.39.5




More information about the Hostap mailing list