netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Daniel Drake <dsd@gentoo.org>
Cc: linville@tuxdriver.com, netdev@vger.kernel.org,
	johannes@sipsolutions.net, mb@bu3sch.de,
	ipw2100-admin@linux.intel.com
Subject: Re: [PATCH] ieee80211: Move IV/ICV stripping into ieee80211_rx
Date: Tue, 26 Sep 2006 23:02:16 -0500	[thread overview]
Message-ID: <4519F7C8.2040503@lwfinger.net> (raw)
In-Reply-To: <20060927025031.90F567B40A0@zog.reactivated.net>

Daniel Drake wrote:
> This patch adds a host_strip_iv_icv flag to ieee80211 which indicates that
> ieee80211_rx should strip the IV/ICV/other security features from the payload.
> This saves on some memmove() calls in the driver and seems like something that
> belongs in the stack as it can be used by bcm43xx, ipw2200, and zd1211rw
> 
> I will submit the ipw2200 patch separately as it needs testing.
> 
> This patch also adds some sensible variable reuse (idx vs keyidx) in
> ieee80211_rx
> 
> Signed-off-by: Daniel Drake <dsd@gentoo.org>
> Acked-by: Johannes Berg <johannes@sipsolutions.net>
> 
> Index: linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
> ===================================================================
> --- linux.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
> +++ linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
> @@ -543,25 +543,6 @@ int bcm43xx_rx(struct bcm43xx_private *b
>  		break;
>  	}
>  
> -	frame_ctl = le16_to_cpu(wlhdr->frame_ctl);
> -	if ((frame_ctl & IEEE80211_FCTL_PROTECTED) && !bcm->ieee->host_decrypt) {
> -		frame_ctl &= ~IEEE80211_FCTL_PROTECTED;
> -		wlhdr->frame_ctl = cpu_to_le16(frame_ctl);		
> -		/* trim IV and ICV */
> -		/* FIXME: this must be done only for WEP encrypted packets */
> -		if (skb->len < 32) {
> -			dprintkl(KERN_ERR PFX "RX packet dropped (PROTECTED flag "
> -					      "set and length < 32)\n");
> -			return -EINVAL;
> -		} else {		
> -			memmove(skb->data + 4, skb->data, 24);
> -			skb_pull(skb, 4);
> -			skb_trim(skb, skb->len - 4);
> -			stats.len -= 8;
> -		}
> -		wlhdr = (struct ieee80211_hdr_4addr *)(skb->data);
> -	}
> -	
>  	switch (WLAN_FC_GET_TYPE(frame_ctl)) {

At this point, gcc warns that frame_ctl has been used uninitialized. Did you mean to remove the 
extraction of frame_ctl from wlhdr just before the previous 'if'?

Larry


      reply	other threads:[~2006-09-27  4:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-27  2:50 [PATCH] ieee80211: Move IV/ICV stripping into ieee80211_rx Daniel Drake
2006-09-27  4:02 ` Larry Finger [this message]

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=4519F7C8.2040503@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=dsd@gentoo.org \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=netdev@vger.kernel.org \
    /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).