From: "John W. Linville" <linville@tuxdriver.com>
To: Johannes Berg <johannes@sipsolutions.net>
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: Thu, 13 Dec 2007 15:49:33 -0500 [thread overview]
Message-ID: <20071213204933.GD3083@tuxdriver.com> (raw)
In-Reply-To: <1197483844.6558.158.camel@johannes.berg>
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@tuxdriver.com
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2007-12-13 21:29 UTC|newest]
Thread overview: 25+ 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-12 18:24 ` Johannes Berg
2007-12-12 18:39 ` drago01
2007-12-12 18:39 ` drago01
2007-12-13 11:35 ` Johannes Berg
2007-12-13 11:35 ` Johannes Berg
2007-12-13 20:49 ` John W. Linville [this message]
2007-12-13 20:49 ` John W. Linville
2007-12-14 12:14 ` Johannes Berg
2007-12-18 4:22 ` Jouni Malinen
2007-12-18 12:42 ` Johannes Berg
2007-12-18 12:42 ` Johannes Berg
2007-12-14 5:08 ` Jouni Malinen
2007-12-14 5:08 ` Jouni Malinen
2007-12-14 12:13 ` Johannes Berg
2007-12-14 12:13 ` Johannes Berg
2007-12-18 4:18 ` Jouni Malinen
2007-12-18 4:18 ` Jouni Malinen
2007-12-18 12:47 ` Johannes Berg
2007-12-18 12:47 ` Johannes Berg
2007-12-16 9:28 ` Ron Rindjunsky
2007-12-16 13:49 ` Johannes Berg
2007-12-16 13:49 ` Johannes Berg
2007-12-18 14:16 ` 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=20071213204933.GD3083@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=flamingice@sourmilk.net \
--cc=j@w1.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.