From: Johannes Berg <johannes@sipsolutions.net>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
Michael Wu <flamingice@sourmilk.net>,
Tomas Winkler <tomasw@gmail.com>, Jouni Malinen <j@w1.fi>
Subject: Re: [RFC] mac80211: clean up frame receive handling
Date: Fri, 14 Dec 2007 13:14:03 +0100 [thread overview]
Message-ID: <1197634443.16079.36.camel@johannes.berg> (raw)
In-Reply-To: <20071213204933.GD3083@tuxdriver.com>
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
> > +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.
I think in theory all eapol frames are sent to the PAE group address,
but I have no idea which of the checks would be more efficient. It seems
that the first could be optimised a lot because it's constant too...
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2007-12-14 12:17 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
2007-12-16 9:28 ` Ron Rindjunsky
[not found] ` <c85cb4470712160128t7ef525f3md56d05f5990eb81-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-12-16 13:49 ` 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
2007-12-14 12:14 ` Johannes Berg [this message]
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
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=1197634443.16079.36.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=flamingice@sourmilk.net \
--cc=j@w1.fi \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=tomasw@gmail.com \
/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).