netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@gentoo.org>
To: Michael Buesch <mb@bu3sch.de>
Cc: netdev@vger.kernel.org, yi.zhu@intel.com, ipw2100-admin@linux.intel.com
Subject: Re: ieee80211 and devices which decrypt in hardware
Date: Wed, 13 Sep 2006 18:35:37 -0400	[thread overview]
Message-ID: <450887B9.7080308@gentoo.org> (raw)
In-Reply-To: <200609131627.58153.mb@bu3sch.de>

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

Michael Buesch wrote:
> Does it strip ICV and FCS?

The driver always strips FCS (unconditionally).

The device does not strip ICV even when hardware decryption is in use, 
it gets included at the end of the frame, and I guess we should also 
handle that.

> in bcm43xx-softmac we use memmove to move the wireless header 4 bytes
> up and after that strip the first 4 bytes of the skb.
> I don't think there is another easy way to handle this. You'd have
> to modify the stack and softmac. And this would probably result in more
> overhead than the simple memove of 24 bytes.

softmac doesn't need modifying, and the ieee80211 modification is very 
simple. See the attached patch. ieee80211 could also be modified very 
easily to drop the ICV.

Surely this is nicer than adding IEEE802.11 header parsing code to 
zd1211rw rx path (currently there is none, which is nice) and a memmove?

Daniel


[-- Attachment #2: ieee80211-rx-strip-iv.patch --]
[-- Type: text/x-patch, Size: 553 bytes --]

Index: linux/net/ieee80211/ieee80211_rx.c
===================================================================
--- linux.orig/net/ieee80211/ieee80211_rx.c
+++ linux/net/ieee80211/ieee80211_rx.c
@@ -655,6 +655,11 @@ int ieee80211_rx(struct ieee80211_device
 		goto rx_dropped;
 	}
 
+	/* If the device does decryption but leaves the IV in place then we
+	 * need to kill it. */
+	if (!can_be_decrypted && (fc & IEEE80211_FCTL_PROTECTED))
+		hdrlen += 4;
+
 	/* skb: hdr + (possible reassembled) full plaintext payload */
 
 	payload = skb->data + hdrlen;

  reply	other threads:[~2006-09-13 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13  2:51 ieee80211 and devices which decrypt in hardware Daniel Drake
2006-09-13 14:27 ` Michael Buesch
2006-09-13 22:35   ` Daniel Drake [this message]
2006-09-13 22:43     ` Daniel Drake
2006-09-14  7:51     ` Johannes Berg
2006-09-14 15:25     ` Michael Buesch

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=450887B9.7080308@gentoo.org \
    --to=dsd@gentoo.org \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=mb@bu3sch.de \
    --cc=netdev@vger.kernel.org \
    --cc=yi.zhu@intel.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).