From: Michael Buesch <mb@bu3sch.de>
To: John Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org
Subject: [PATCH] b43: Always drop crypt-failed packets.
Date: Tue, 4 Sep 2007 15:18:51 +0200 [thread overview]
Message-ID: <200709041518.52209.mb@bu3sch.de> (raw)
Drop packets for which the firmware was unable to decrypt it,
as we won't be able to decrypt them with the key, too.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-dev/drivers/net/wireless/b43/xmit.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43/xmit.c 2007-08-31 17:40:05.000000000 +0200
+++ wireless-dev/drivers/net/wireless/b43/xmit.c 2007-08-31 18:33:38.000000000 +0200
@@ -465,6 +465,12 @@ void b43_rx(struct b43_wldev *dev, struc
if (macstat & B43_RX_MAC_FCSERR)
dev->wl->ieee_stats.dot11FCSErrorCount++;
+ if (macstat & B43_RX_MAC_DECERR) {
+ /* Decryption with the given key failed.
+ * Drop the packet. We also won't be able to decrypt it with
+ * the key in software. */
+ goto drop;
+ }
/* Skip PLCP and padding */
padding = (macstat & B43_RX_MAC_PADDING) ? 2 : 0;
@@ -483,7 +489,7 @@ void b43_rx(struct b43_wldev *dev, struc
fctl = le16_to_cpu(wlhdr->frame_control);
skb_trim(skb, skb->len - FCS_LEN);
- if ((macstat & B43_RX_MAC_DEC) && !(macstat & B43_RX_MAC_DECERR)) {
+ if (macstat & B43_RX_MAC_DEC) {
unsigned int keyidx;
int wlhdr_len;
int iv_len;
@@ -573,7 +579,7 @@ void b43_rx(struct b43_wldev *dev, struc
ieee80211_rx_irqsafe(dev->wl->hw, skb, &status);
return;
- drop:
+drop:
b43dbg(dev->wl, "RX: Packet dropped\n");
dev_kfree_skb_any(skb);
}
reply other threads:[~2007-09-04 13:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200709041518.52209.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=bcm43xx-dev@lists.berlios.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).