[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1197634443.16079.36.camel@johannes.berg>
Date: Fri, 14 Dec 2007 13:14:03 +0100
From: Johannes Berg <johannes@...solutions.net>
To: "John W. Linville" <linville@...driver.com>
Cc: linux-wireless <linux-wireless@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
Michael Wu <flamingice@...rmilk.net>,
Tomas Winkler <tomasw@...il.com>, Jouni Malinen <j@...fi>
Subject: Re: [RFC] mac80211: clean up frame receive handling
> > +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
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists