linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC]: atk5k: fix FCS corruption for ACKs
@ 2008-12-10  5:04 Patrick McHardy
  2008-12-10 13:24 ` Bob Copeland
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick McHardy @ 2008-12-10  5:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jiri Slaby, mickflemm, mcgrof, me

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

When running a monitor interface with ath5k, the FCS of ACK
frames is two bytes short. The reason is that unlike the
payload, the FCS doesn't seem to aligned to a 4 byte boundary
by the chip, the attempt to remove the padding corrupts it.

This patch checks whether there actually is any payload after
the header (besides the FCS) before removing the padding.

This might not be fully correct or not handle other cases where
this can occur, but it doesn't seem too hackish and fixes the
problem for me :)

http://bugzilla.kernel.org/show_bug.cgi?id=12101


[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 874 bytes --]

commit 8c1d598338077d397aed25fe4840e4d4b51ba79c
Author: Patrick McHardy <kaber@trash.net>
Date:   Tue Dec 9 21:52:00 2008 +0100

    atk5k: fix FCS corruption for ACKs
    
    The trailing FCS value is not aliged when no payload is present. Don't try
    to remove padding to avoid corrupting it.

    Kernel Bugzilla #12101
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index d9e1980..940c724 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1752,7 +1752,7 @@ accept:
 		 * not multiples of 4 - remove it
 		 */
 		hdrlen = ieee80211_get_hdrlen_from_skb(skb);
-		if (hdrlen & 3) {
+		if (hdrlen & 3 && hdrlen != rs.rs_datalen - FCS_LEN) {
 			pad = hdrlen % 4;
 			memmove(skb->data + pad, skb->data, hdrlen);
 			skb_pull(skb, pad);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-11 19:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10  5:04 [RFC]: atk5k: fix FCS corruption for ACKs Patrick McHardy
2008-12-10 13:24 ` Bob Copeland
2008-12-10 13:36   ` Johannes Berg
2008-12-10 13:43   ` Sujith
2008-12-10 14:48     ` Bob Copeland
2008-12-11 19:59   ` Bob Copeland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).