Commit 087d833e authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

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: default avatarJouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 988b02f1
...@@ -478,51 +478,21 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info( ...@@ -478,51 +478,21 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info(
static void ieee80211_sta_send_associnfo(struct net_device *dev, static void ieee80211_sta_send_associnfo(struct net_device *dev,
struct ieee80211_if_sta *ifsta) struct ieee80211_if_sta *ifsta)
{ {
char *buf;
size_t len;
int i;
union iwreq_data wrqu; union iwreq_data wrqu;
if (!ifsta->assocreq_ies && !ifsta->assocresp_ies)
return;
buf = kmalloc(50 + 2 * (ifsta->assocreq_ies_len +
ifsta->assocresp_ies_len), GFP_KERNEL);
if (!buf)
return;
len = sprintf(buf, "ASSOCINFO(");
if (ifsta->assocreq_ies) { if (ifsta->assocreq_ies) {
len += sprintf(buf + len, "ReqIEs="); memset(&wrqu, 0, sizeof(wrqu));
for (i = 0; i < ifsta->assocreq_ies_len; i++) { wrqu.data.length = ifsta->assocreq_ies_len;
len += sprintf(buf + len, "%02x", wireless_send_event(dev, IWEVASSOCREQIE, &wrqu,
ifsta->assocreq_ies[i]); ifsta->assocreq_ies);
}
}
if (ifsta->assocresp_ies) {
if (ifsta->assocreq_ies)
len += sprintf(buf + len, " ");
len += sprintf(buf + len, "RespIEs=");
for (i = 0; i < ifsta->assocresp_ies_len; i++) {
len += sprintf(buf + len, "%02x",
ifsta->assocresp_ies[i]);
}
}
len += sprintf(buf + len, ")");
if (len > IW_CUSTOM_MAX) {
len = sprintf(buf, "ASSOCRESPIE=");
for (i = 0; i < ifsta->assocresp_ies_len; i++) {
len += sprintf(buf + len, "%02x",
ifsta->assocresp_ies[i]);
}
} }
if (ifsta->assocresp_ies) {
memset(&wrqu, 0, sizeof(wrqu)); memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.length = len; wrqu.data.length = ifsta->assocresp_ies_len;
wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu,
ifsta->assocresp_ies);
kfree(buf); }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment