Linux wireless drivers development
 help / color / mirror / Atom feed
From: Michael Wu <flamingice@sourmilk.net>
To: Volker Braun <volker.braun@physik.hu-berlin.de>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>,
	Jiri Benc <jbenc@suse.cz>
Subject: Re: [PATCHv2] mac80211: dynamic wep
Date: Mon, 13 Aug 2007 00:54:53 -0700	[thread overview]
Message-ID: <200708130054.57899.flamingice@sourmilk.net> (raw)
In-Reply-To: <pan.2007.08.10.23.31.32@physik.hu-berlin.de>

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

On Friday 10 August 2007 16:31, Volker Braun wrote:
> This patch fixes my problems with "dynamic wep" (widely used in
> universities), and I can now successfully associate and transfer
> data using mac80211+iwl4965. Main changes:
> 1) Allow privacy mismatch until associated
> 2) Decrypt unicast frames with the per-STA key, not making any
>    assumptions about it being key index 0.
>
> Signed-off-by: Volker Braun <volker.braun@physik.hu-berlin.de>
> ---
Hm, you somehow got a copy of this to me without actually putting me on the CC 
list.. you should probably use CC instead.

> -0400 @@ -357,7 +357,7 @@ struct ieee80211_cts {
>  #define WLAN_CAPABILITY_IBSS		(1<<1)
>  #define WLAN_CAPABILITY_CF_POLLABLE	(1<<2)
>  #define WLAN_CAPABILITY_CF_POLL_REQUEST	(1<<3)
> -#define WLAN_CAPABILITY_PRIVACY		(1<<4)
> +#define WLAN_CAPABILITY_PRIVACY		(1<<4) /* Force WEP on data packets */
Anyone interested in what this bit is can read the spec. Also, your comment is 
inaccurate, as this bit is not specific to WEP.

> +	if (rx->fc & IEEE80211_FCTL_PROTECTED && /* WEP */
Inaccurate and unnecessary comment.

> -			if (keyidx >= 0 && keyidx < NUM_DEFAULT_KEYS &&
> -			    (!rx->sta || !rx->sta->key || keyidx > 0))
> -				rx->key = rx->sdata->keys[keyidx];
So it looks like the keyidx > 0 check here is the source of the RX problems. I 
think we can store the keyidx of the individual key to compare against 
instead of assuming all individual keys have a keyidx of 0.

> -0400 @@ -1131,10 +1131,11 @@ static int ieee80211_privacy_mismatch(st
>  	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
>  	if (!bss)
>  		return 0;
> -
> -	if (ieee80211_sta_wep_configured(dev) !=
> -	    !!(bss->capability & WLAN_CAPABILITY_PRIVACY))
> -		res = 1;
> +
> +	if (ifsta->associated && ieee80211_sta_wep_configured(dev) !=
> +	    !!(bss->capability & WLAN_CAPABILITY_PRIVACY)) {
> +		res = 1;  /* associated and WEP encryption mismatch */
> +	}
Another unneeded comment. Don't add braces when it's not needed.

This part seems fairly evil. I suspect a better solution here is to allow 
unencrypted frames when the interface is dormant (netif_dormant()) and then 
we might be able to get rid of the specific check for WEP.

-Michael Wu

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-08-13  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 23:31 [PATCHv2] mac80211: dynamic wep Volker Braun
2007-08-13  7:54 ` Michael Wu [this message]
2007-08-13  8:54   ` Johannes Berg
2007-08-13 15:48     ` Michael Wu
2007-08-13 15:12   ` Volker Braun
2007-08-15  1:47 ` Johannes Berg
2007-08-15 15:51   ` Volker Braun

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=200708130054.57899.flamingice@sourmilk.net \
    --to=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=volker.braun@physik.hu-berlin.de \
    /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