Search Linux Wireless

Re: [PATCH] mac80211 : fix a race with update_tkip_key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-06-10 at 21:42 +0200, gregor kowski wrote:

>  	if (only_iv) {
>  		res = TKIP_DECRYPT_OK;
> -		key->u.tkip.rx[queue].initialized = 1;
> +		key->u.tkip.rx[queue].initialized = 2;
>  		goto done;

Please change this variable to an enum with proper states.

> -		if (key->local->ops->update_tkip_key &&
> -			key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
> -			u8 bcast[ETH_ALEN] =
> -				{0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -			u8 *sta_addr = key->sta->sta.addr;
> -
> -			if (is_multicast_ether_addr(ra))
> -				sta_addr = bcast;
> -
> -			key->local->ops->update_tkip_key(
> -				local_to_hw(key->local), &key->conf,
> -				sta_addr, iv32, key->u.tkip.rx[queue].p1k);
> -		}
> +	}
> +	/* initialized == 2 means we already call update_tkip_key */
> +	if (key->local->ops->update_tkip_key &&
> +		key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
> +		key->u.tkip.rx[queue].initialized != 2) {

and please indent only to after if ( here, like this:

	if (key->... &&
	    key->flags & ...
	    key->...) {
		u8 bcast[...]...

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux