]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Multi-AP: Parse Profile subelement
authorManoj Sekar <quic_sekar@quicinc.com>
Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 19 Mar 2024 16:55:14 +0000 (18:55 +0200)
Parse the indicate profile support for the Multi-AP Profile subelement.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
src/common/ieee802_11_common.c

index 97c0405d3428eddbbe29e32790c0095920a31728..560e48a38703a292812e00999865530096a68901 100644 (file)
@@ -2579,6 +2579,10 @@ u16 check_multi_ap_ie(const u8 *multi_ap_ie, size_t multi_ap_len,
 
        os_memset(multi_ap, 0, sizeof(*multi_ap));
 
+       /* Default profile is 1, when Multi-AP profile subelement is not
+        * present in the element. */
+       multi_ap->profile = 1;
+
        for_each_element(elem, multi_ap_ie, multi_ap_len) {
                u8 id = elem->id, elen = elem->datalen;
                const u8 *pos = elem->data;
@@ -2594,6 +2598,21 @@ u16 check_multi_ap_ie(const u8 *multi_ap_ie, size_t multi_ap_len,
                                return WLAN_STATUS_INVALID_IE;
                        }
                        break;
+               case MULTI_AP_PROFILE_SUB_ELEM_TYPE:
+                       if (elen < 1) {
+                               wpa_printf(MSG_DEBUG,
+                                          "Multi-AP IE invalid Multi-AP profile subelement");
+                               return WLAN_STATUS_INVALID_IE;
+                       }
+
+                       multi_ap->profile = *pos;
+                       if (multi_ap->profile > MULTI_AP_PROFILE_MAX) {
+                               wpa_printf(MSG_DEBUG,
+                                          "Multi-AP IE with invalid profile 0x%02x",
+                                          multi_ap->profile);
+                               return WLAN_STATUS_ASSOC_DENIED_UNSPEC;
+                       }
+                       break;
                default:
                        wpa_printf(MSG_DEBUG,
                                   "Ignore unknown subelement %u in Multi-AP IE",