]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Add Secondary Device Type list in Probe Response frames
authorJean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Thu, 17 Mar 2011 09:16:23 +0000 (11:16 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 17 Mar 2011 09:16:23 +0000 (11:16 +0200)
Add Secondary Device Type List attribute in WSC IE for P2P
Probe Response frames if one or more secondary device types
are configured.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
src/p2p/p2p_build.c

index 791809e6ed137733479f5fc30cc479d749a3cb44..c582a3177420a99c1c85c125808b2ebbe4a973d5 100644 (file)
@@ -385,5 +385,14 @@ void p2p_build_wps_ie(struct p2p_data *p2p, struct wpabuf *buf, u16 pw_id,
 
        wps_build_wfa_ext(buf, 0, NULL, 0);
 
+       if (all_attr && p2p->cfg->num_sec_dev_types) {
+               wpabuf_put_be16(buf, ATTR_SECONDARY_DEV_TYPE_LIST);
+               wpabuf_put_be16(buf, WPS_DEV_TYPE_LEN *
+                               p2p->cfg->num_sec_dev_types);
+               wpabuf_put_data(buf, p2p->cfg->sec_dev_type,
+                               WPS_DEV_TYPE_LEN *
+                               p2p->cfg->num_sec_dev_types);
+       }
+
        p2p_buf_update_ie_hdr(buf, len);
 }