netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
To: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
Cc: linux-wireless
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	netdev <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Michael Wu <flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>,
	Tomas Winkler <tomasw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jouni Malinen <j@w1.fi>
Subject: Re: [RFC] mac80211: clean up frame receive handling
Date: Thu, 13 Dec 2007 15:49:33 -0500	[thread overview]
Message-ID: <20071213204933.GD3083@tuxdriver.com> (raw)
In-Reply-To: <1197483844.6558.158.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>

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-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org

  parent reply	other threads:[~2007-12-13 20:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12 18:24 [RFC] mac80211: clean up frame receive handling Johannes Berg
     [not found] ` <1197483844.6558.158.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-12 18:39   ` drago01
     [not found]     ` <f6ca9fed0712121039n1c287f48n7ece3107bd0b50ca-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-12-13 11:35       ` Johannes Berg
2007-12-13 20:49   ` John W. Linville [this message]
2007-12-14 12:14     ` Johannes Berg
2007-12-18  4:22       ` Jouni Malinen
     [not found]         ` <20071218042253.GC5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>
2007-12-18 12:42           ` Johannes Berg
2007-12-14  5:08   ` Jouni Malinen
     [not found]     ` <20071214050808.GE5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>
2007-12-14 12:13       ` Johannes Berg
     [not found]         ` <1197634385.16079.34.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-18  4:18           ` Jouni Malinen
     [not found]             ` <20071218041810.GB5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>
2007-12-18 12:47               ` Johannes Berg
2007-12-18 14:16   ` Johannes Berg
2007-12-16  9:28 ` Ron Rindjunsky
     [not found]   ` <c85cb4470712160128t7ef525f3md56d05f5990eb81-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-12-16 13:49     ` Johannes Berg

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=20071213204933.GD3083@tuxdriver.com \
    --to=linville-2xusbdqka4r54taoqtywwq@public.gmane.org \
    --cc=flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org \
    --cc=j@w1.fi \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tomasw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).