aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-08-19 03:54:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-26 20:06:32 -0400
commit087d833e5a9f67ba933cb32eaf5a2279c1a5b47c (patch)
tree4fec52d3c6628184bb5d6ac417fa5409f04d22e6 /net/mac80211
parent988b02f1bf5b608ef91a9d98c7170d037d0f12e3 (diff)
mac80211: Use IWEVASSOCREQIE instead of IWEVCUSTOM
The previous code was using IWEVCUSTOM to report IEs from AssocReq and AssocResp frames into user space. This can easily hit the 256 byte limit (IW_CUSTOM_MAX) with APs that include number of vendor IEs in AssocResp. This results in the event message not being sent and dmesg showing "wlan0 (WE) : Wireless Event too big (366)" type of errors. Convert mac80211 to use IWEVASSOCREQIE/IWEVASSOCRESPIE to avoid the issue of being unable to send association IEs as wireless events. These newer event types use binary encoding and larger maximum size (IW_GENERIC_IE_MAX = 1024), so the likelyhood of not being able to send the IEs is much smaller than with IWEVCUSTOM. As an extra benefit, the code is also quite a bit simpler since there is no need to allocate an extra buffer for hex encoding. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c48
1 files changed, 9 insertions, 39 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1e97fb9fb34b..09a56e24b799 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -478,51 +478,21 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info(
478static void ieee80211_sta_send_associnfo(struct net_device *dev, 478static void ieee80211_sta_send_associnfo(struct net_device *dev,
479 struct ieee80211_if_sta *ifsta) 479 struct ieee80211_if_sta *ifsta)
480{ 480{
481 char *buf;
482 size_t len;
483 int i;
484 union iwreq_data wrqu; 481 union iwreq_data wrqu;
485 482
486 if (!ifsta->assocreq_ies && !ifsta->assocresp_ies)
487 return;
488
489 buf = kmalloc(50 + 2 * (ifsta->assocreq_ies_len +
490 ifsta->assocresp_ies_len), GFP_KERNEL);
491 if (!buf)
492 return;
493
494 len = sprintf(buf, "ASSOCINFO(");
495 if (ifsta->assocreq_ies) { 483 if (ifsta->assocreq_ies) {
496 len += sprintf(buf + len, "ReqIEs="); 484 memset(&wrqu, 0, sizeof(wrqu));
497 for (i = 0; i < ifsta->assocreq_ies_len; i++) { 485 wrqu.data.length = ifsta->assocreq_ies_len;
498 len += sprintf(buf + len, "%02x", 486 wireless_send_event(dev, IWEVASSOCREQIE, &wrqu,
499 ifsta->assocreq_ies[i]); 487 ifsta->assocreq_ies);
500 }
501 }
502 if (ifsta->assocresp_ies) {
503 if (ifsta->assocreq_ies)
504 len += sprintf(buf + len, " ");
505 len += sprintf(buf + len, "RespIEs=");
506 for (i = 0; i < ifsta->assocresp_ies_len; i++) {
507 len += sprintf(buf + len, "%02x",
508 ifsta->assocresp_ies[i]);
509 }
510 } 488 }
511 len += sprintf(buf + len, ")");
512 489
513 if (len > IW_CUSTOM_MAX) { 490 if (ifsta->assocresp_ies) {
514 len = sprintf(buf, "ASSOCRESPIE="); 491 memset(&wrqu, 0, sizeof(wrqu));
515 for (i = 0; i < ifsta->assocresp_ies_len; i++) { 492 wrqu.data.length = ifsta->assocresp_ies_len;
516 len += sprintf(buf + len, "%02x", 493 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu,
517 ifsta->assocresp_ies[i]); 494 ifsta->assocresp_ies);
518 }
519 } 495 }
520
521 memset(&wrqu, 0, sizeof(wrqu));
522 wrqu.data.length = len;
523 wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
524
525 kfree(buf);
526} 496}
527 497
528 498