Search Linux Wireless

Re: [RFC] mac80211: clean up frame receive handling

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

 



On Wed, Dec 12, 2007 at 07:24:04PM +0100, Johannes Berg wrote:

> @@ -1014,6 +992,24 @@ ieee80211_drop_unencrypted(struct ieee80
>  	return 0;
>  }
>  
> +static bool ieee80211_frame_allowed(struct ieee80211_txrx_data *rx)
> +{
> +	static const u8 pae_group_addr[ETH_ALEN]
> +		= { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 };
> +	struct ethhdr *ehdr = (struct ethhdr *)rx->skb->data;
> +
> +	if (rx->skb->protocol == htons(ETH_P_PAE) &&
> +	    (compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0 ||
> +	     compare_ether_addr(ehdr->h_dest, rx->dev->dev_addr) == 0))
> +		return true;

Should you reverse these two compare_ether_addr calls?
rx->dev->dev_addr seems more likely for any given packet.  It probably
makes little difference but it seems like checking for that first
would still be better.

John
-- 
John W. Linville
linville@xxxxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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