From 3d0fb95583de4f86bfba0153195b84b476a0deaa Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 20 Oct 2017 17:44:07 +0300 Subject: [PATCH] WNM: Ignore BSS Transition Management frames in bss_transition=0 case The hostapd bss_transition parameter was previously used to control advertisement of BSS Transition Management support, but it was not used when processing BSS Transition Management Query/Response frames. Add an explicit check during frame processing as well so that any misbehaving station is ignored. In addition to bss_transition=1, allow mbo=1 to be used to mark the functionality enabled. Signed-off-by: Jouni Malinen --- src/ap/wnm_ap.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c index 973e4d332..bbc26a5a2 100644 --- a/src/ap/wnm_ap.c +++ b/src/ap/wnm_ap.c @@ -302,6 +302,20 @@ static void ieee802_11_rx_bss_trans_mgmt_query(struct hostapd_data *hapd, { u8 dialog_token, reason; const u8 *pos, *end; + int enabled = hapd->conf->bss_transition; + +#ifdef CONFIG_MBO + if (hapd->conf->mbo_enabled) + enabled = 1; +#endif /* CONFIG_MBO */ + if (!enabled) { + wpa_printf(MSG_DEBUG, + "Ignore BSS Transition Management Query from " + MACSTR + " since BSS Transition Management is disabled", + MAC2STR(addr)); + return; + } if (len < 2) { wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Query from " @@ -331,6 +345,20 @@ static void ieee802_11_rx_bss_trans_mgmt_resp(struct hostapd_data *hapd, { u8 dialog_token, status_code, bss_termination_delay; const u8 *pos, *end; + int enabled = hapd->conf->bss_transition; + +#ifdef CONFIG_MBO + if (hapd->conf->mbo_enabled) + enabled = 1; +#endif /* CONFIG_MBO */ + if (!enabled) { + wpa_printf(MSG_DEBUG, + "Ignore BSS Transition Management Response from " + MACSTR + " since BSS Transition Management is disabled", + MAC2STR(addr)); + return; + } if (len < 3) { wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Response from "