]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ANQP: Extend ANQP_GET command to request without IEEE 802.11 elements
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 10 Mar 2017 15:02:22 +0000 (17:02 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 10 Mar 2017 15:02:22 +0000 (17:02 +0200)
Previously, ANQP_GET required at least one IEEE 802.11 ANQP-element to
be requested. This is not really necessary, so allow a case where
num_ids == 0 as long as the request includes at least one Hotspot 2.0 or
MBO ANQP-element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/interworking.c

index 5aa3542bcc1162e96af2c263d79eb5d797b41ff0..08348d292037f0de5b8847e824e0439c75582a0e 100644 (file)
@@ -6751,7 +6751,7 @@ static int get_anqp(struct wpa_supplicant *wpa_s, char *dst)
                pos++;
        }
 
-       if (num_id == 0)
+       if (num_id == 0 && !subtypes && !mbo_subtypes)
                return -1;
 
        return anqp_send_req(wpa_s, dst_addr, id, num_id, subtypes,
index 24bbeff33717103bc39c5bf83d0bb02c98dc59e1..b9ec124613f0080e6c622de6133989444296b53c 100644 (file)
@@ -106,10 +106,12 @@ static struct wpabuf * anqp_build_req(u16 info_ids[], size_t num_ids,
        if (buf == NULL)
                return NULL;
 
-       len_pos = gas_anqp_add_element(buf, ANQP_QUERY_LIST);
-       for (i = 0; i < num_ids; i++)
-               wpabuf_put_le16(buf, info_ids[i]);
-       gas_anqp_set_element_len(buf, len_pos);
+       if (num_ids > 0) {
+               len_pos = gas_anqp_add_element(buf, ANQP_QUERY_LIST);
+               for (i = 0; i < num_ids; i++)
+                       wpabuf_put_le16(buf, info_ids[i]);
+               gas_anqp_set_element_len(buf, len_pos);
+       }
        if (extra)
                wpabuf_put_buf(buf, extra);