summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-02-04 03:48:34 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-05 08:03:24 -0500
commit4d9523005f956e23da2df1b884a08c17e2a2d5a2 (patch)
tree58f8b8329ee6c2e5168a8244772f20974d8e97b2
parent8c78e38025060a00155a73bf722152c156242490 (diff)
mac80211: order IEs in probe request correctly
In probe request frames, the VHT IEs should come before any vendor IEs, but after interworking and similar, so add code to order them correctly wrt. the IEs passed from userspace. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/util.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 503bbced21f0..caa0cd4f1926 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1281,13 +1281,32 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1281 * that calculates local->scan_ies_len. 1281 * that calculates local->scan_ies_len.
1282 */ 1282 */
1283 1283
1284 /* add any remaining custom IEs */ 1284 /* insert custom IEs that go before VHT */
1285 if (ie && ie_len) { 1285 if (ie && ie_len) {
1286 noffset = ie_len; 1286 static const u8 before_vht[] = {
1287 WLAN_EID_SSID,
1288 WLAN_EID_SUPP_RATES,
1289 WLAN_EID_REQUEST,
1290 WLAN_EID_EXT_SUPP_RATES,
1291 WLAN_EID_DS_PARAMS,
1292 WLAN_EID_SUPPORTED_REGULATORY_CLASSES,
1293 WLAN_EID_HT_CAPABILITY,
1294 WLAN_EID_BSS_COEX_2040,
1295 WLAN_EID_EXT_CAPABILITY,
1296 WLAN_EID_SSID_LIST,
1297 WLAN_EID_CHANNEL_USAGE,
1298 WLAN_EID_INTERWORKING,
1299 /* mesh ID can't happen here */
1300 /* 60 GHz can't happen here right now */
1301 };
1302 noffset = ieee80211_ie_split(ie, ie_len,
1303 before_vht, ARRAY_SIZE(before_vht),
1304 offset);
1287 if (end - pos < noffset - offset) 1305 if (end - pos < noffset - offset)
1288 goto out_err; 1306 goto out_err;
1289 memcpy(pos, ie + offset, noffset - offset); 1307 memcpy(pos, ie + offset, noffset - offset);
1290 pos += noffset - offset; 1308 pos += noffset - offset;
1309 offset = noffset;
1291 } 1310 }
1292 1311
1293 if (sband->vht_cap.vht_supported) { 1312 if (sband->vht_cap.vht_supported) {
@@ -1297,6 +1316,15 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1297 sband->vht_cap.cap); 1316 sband->vht_cap.cap);
1298 } 1317 }
1299 1318
1319 /* add any remaining custom IEs */
1320 if (ie && ie_len) {
1321 noffset = ie_len;
1322 if (end - pos < noffset - offset)
1323 goto out_err;
1324 memcpy(pos, ie + offset, noffset - offset);
1325 pos += noffset - offset;
1326 }
1327
1300 return pos - buffer; 1328 return pos - buffer;
1301 out_err: 1329 out_err:
1302 WARN_ONCE(1, "not enough space for preq IEs\n"); 1330 WARN_ONCE(1, "not enough space for preq IEs\n");