linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: Always drop crypt-failed packets.
@ 2007-09-04 13:18 Michael Buesch
  0 siblings, 0 replies; only message in thread
From: Michael Buesch @ 2007-09-04 13:18 UTC (permalink / raw)
  To: John Linville; +Cc: Johannes Berg, bcm43xx-dev, linux-wireless

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);
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-04 13:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-04 13:18 [PATCH] b43: Always drop crypt-failed packets Michael Buesch

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).