aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 9bb68c6a8f44..902cac1bd246 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -478,21 +478,51 @@ 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;
481 union iwreq_data wrqu; 484 union iwreq_data wrqu;
482 485
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(");
483 if (ifsta->assocreq_ies) { 495 if (ifsta->assocreq_ies) {
484 memset(&wrqu, 0, sizeof(wrqu)); 496 len += sprintf(buf + len, "ReqIEs=");
485 wrqu.data.length = ifsta->assocreq_ies_len; 497 for (i = 0; i < ifsta->assocreq_ies_len; i++) {
486 wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, 498 len += sprintf(buf + len, "%02x",
487 ifsta->assocreq_ies); 499 ifsta->assocreq_ies[i]);
500 }
488 } 501 }
489
490 if (ifsta->assocresp_ies) { 502 if (ifsta->assocresp_ies) {
491 memset(&wrqu, 0, sizeof(wrqu)); 503 if (ifsta->assocreq_ies)
492 wrqu.data.length = ifsta->assocresp_ies_len; 504 len += sprintf(buf + len, " ");
493 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, 505 len += sprintf(buf + len, "RespIEs=");
494 ifsta->assocresp_ies); 506 for (i = 0; i < ifsta->assocresp_ies_len; i++) {
507 len += sprintf(buf + len, "%02x",
508 ifsta->assocresp_ies[i]);
509 }
510 }
511 len += sprintf(buf + len, ")");
512
513 if (len > IW_CUSTOM_MAX) {
514 len = sprintf(buf, "ASSOCRESPIE=");
515 for (i = 0; i < ifsta->assocresp_ies_len; i++) {
516 len += sprintf(buf + len, "%02x",
517 ifsta->assocresp_ies[i]);
518 }
495 } 519 }
520
521 memset(&wrqu, 0, sizeof(wrqu));
522 wrqu.data.length = len;
523 wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
524
525 kfree(buf);
496} 526}
497 527
498 528