From: Avraham Stern <avraham.stern@xxxxxxxxx> When rejecting a BSS transition request, add MBO IE to the BSS transition response frame to specify the transition rejection reason. Signed-off-by: David Spinadel <david.spinadel@xxxxxxxxx> Signed-off-by: Avraham Stern <avraham.stern@xxxxxxxxx> --- wpa_supplicant/mbo.c | 16 ++++++++++++++++ wpa_supplicant/wnm_sta.c | 8 ++++++++ wpa_supplicant/wpa_supplicant_i.h | 3 +++ 3 files changed, 27 insertions(+) diff --git a/wpa_supplicant/mbo.c b/wpa_supplicant/mbo.c index 1e28545..2fda743 100644 --- a/wpa_supplicant/mbo.c +++ b/wpa_supplicant/mbo.c @@ -714,3 +714,19 @@ fail: wpa_printf(MSG_DEBUG, "MBO IE parse failed (id=%u len=%u left=%zu)", id, elen, len); } + + +size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos, + size_t len, + enum mbo_transition_reject_reason reason) +{ + size_t res; + u8 reject_attr[3]; + + reject_attr[0] = MBO_ATTR_ID_TRANSITION_REJECT_REASON; + reject_attr[1] = 1; + reject_attr[2] = reason; + + res = mbo_add_ie(pos, len, reject_attr, sizeof(reject_attr)); + return res; +} diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index a3cf32d..7270b88 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -619,6 +619,14 @@ static void wnm_send_bss_transition_mgmt_resp( pos += ETH_ALEN; } +#ifdef CONFIG_MBO + if (status != WNM_BSS_TM_ACCEPT) { + pos += wpas_mbo_ie_bss_trans_reject(wpa_s, pos, + buf + sizeof(buf) - pos, + MBO_TRANSITION_REJECT_REASON_UNSPECIFIED); + } +#endif /* CONFIG_MBO */ + len = pos - (u8 *) &mgmt->u.action.category; res = wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, wpa_s->bssid, diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 9c09fd7..2ab7026 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1164,6 +1164,9 @@ int wpas_mbo_supp_op_class_ie(struct wpa_supplicant *wpa_s, int freq, u8 *pos, size_t len); void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie, size_t len); +size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos, + size_t len, + enum mbo_transition_reject_reason reason); /** * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response -- 1.9.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap