summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi/if_iwi.c
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2010-10-23 11:26:22 +0000
committerbschmidt <bschmidt@FreeBSD.org>2010-10-23 11:26:22 +0000
commit5633f7ef7b898ad3643c85ce07dd2c05a53cfe6a (patch)
treeabbcc2421d4df54414848f0388b3d863801e4f69 /sys/dev/iwi/if_iwi.c
parent0e4c81027703bc6d197dfa83a76161b7663331ae (diff)
downloadFreeBSD-src-5633f7ef7b898ad3643c85ce07dd2c05a53cfe6a.zip
FreeBSD-src-5633f7ef7b898ad3643c85ce07dd2c05a53cfe6a.tar.gz
The firmware does pad notifications to an even number of bytes (at least
the association notification), the included information though always contains an elem block with an odd number of bytes. We handle the last byte as if it might contain a whole elem block, this of course is not true as one byte is not enough to hold a block, we therefore discard the complete frame. The solution here is to subtract one from the actual notification length, this is also what the Linux driver does. With this change the frames ends exactly where the last elem block ends. This commit also reverts r214160 which is no longer required and now even wrong. MFC after: 1 week
Diffstat (limited to 'sys/dev/iwi/if_iwi.c')
-rw-r--r--sys/dev/iwi/if_iwi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 62b53be..de2bfb1 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -1356,7 +1356,7 @@ iwi_checkforqos(struct ieee80211vap *vap,
wme = NULL;
while (frm < efrm) {
- IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], break);
+ IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], return);
switch (*frm) {
case IEEE80211_ELEMID_VENDOR:
if (iswmeoui(frm))
@@ -1483,7 +1483,7 @@ iwi_notification_intr(struct iwi_softc *sc, struct iwi_notif *notif)
IWI_STATE_END(sc, IWI_FW_ASSOCIATING);
iwi_checkforqos(vap,
(const struct ieee80211_frame *)(assoc+1),
- le16toh(notif->len) - sizeof(*assoc));
+ le16toh(notif->len) - sizeof(*assoc) - 1);
ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
break;
case IWI_ASSOC_INIT:
OpenPOWER on IntegriCloud