]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Always include Non-preferred Channel Report attribute in AssocReq
authorAnkita Bajaj <bankita@codeaurora.org>
Fri, 5 Apr 2019 09:07:40 +0000 (14:37 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 5 Apr 2019 17:43:59 +0000 (20:43 +0300)
Include the Non-preferred Channel Report attribute in (Re)Association
Request frames even when the MBO STA has no non-preferred channels in
any operating classes. In case of no non-preferred channels the
attribute length field shall be set to zero and the Operating Class,
Channel List, Preference and Reason Code fields shall not be included.
This indicates to the MBO AP that the MBO STA has no non-preferred
channels access all supported operating classes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/mbo.c

index d2f145114b17845ed5671f0b5ab457ddfc23296c..43722a976d7c1a7cddc7e6269d563b88c2c0f33d 100644 (file)
@@ -98,6 +98,13 @@ static void wpas_mbo_non_pref_chan_attr_body(struct wpa_supplicant *wpa_s,
 }
 
 
+static void wpas_mbo_non_pref_chan_attr_hdr(struct wpabuf *mbo, size_t size)
+{
+       wpabuf_put_u8(mbo, MBO_ATTR_ID_NON_PREF_CHAN_REPORT);
+       wpabuf_put_u8(mbo, size); /* Length */
+}
+
+
 static void wpas_mbo_non_pref_chan_attr(struct wpa_supplicant *wpa_s,
                                        struct wpabuf *mbo, u8 start, u8 end)
 {
@@ -106,9 +113,7 @@ static void wpas_mbo_non_pref_chan_attr(struct wpa_supplicant *wpa_s,
        if (size + 2 > wpabuf_tailroom(mbo))
                return;
 
-       wpabuf_put_u8(mbo, MBO_ATTR_ID_NON_PREF_CHAN_REPORT);
-       wpabuf_put_u8(mbo, size); /* Length */
-
+       wpas_mbo_non_pref_chan_attr_hdr(mbo, size);
        wpas_mbo_non_pref_chan_attr_body(wpa_s, mbo, start, end);
 }
 
@@ -145,6 +150,8 @@ static void wpas_mbo_non_pref_chan_attrs(struct wpa_supplicant *wpa_s,
        if (!wpa_s->non_pref_chan || !wpa_s->non_pref_chan_num) {
                if (subelement)
                        wpas_mbo_non_pref_chan_subelem_hdr(mbo, 4);
+               else
+                       wpas_mbo_non_pref_chan_attr_hdr(mbo, 0);
                return;
        }
        start_pref = &wpa_s->non_pref_chan[0];