From: Michael Buesch <mb@bu3sch.de>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless <linux-wireless@vger.kernel.org>,
John Linville <linville@tuxdriver.com>
Subject: Re: [RFC-PATCH] mac80211: add helpers for frame control tests
Date: Fri, 16 May 2008 22:42:27 +0200 [thread overview]
Message-ID: <200805162242.28181.mb@bu3sch.de> (raw)
In-Reply-To: <1210966704.5915.51.camel@brick>
On Friday 16 May 2008 21:38:23 Harvey Harrison wrote:
> diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
> index 45709ad..f899a06 100644
> --- a/net/mac80211/wpa.c
> +++ b/net/mac80211/wpa.c
> @@ -24,23 +24,21 @@ static int ieee80211_get_hdr_info(const struct sk_buff *skb, u8 **sa, u8 **da,
> {
> struct ieee80211_hdr *hdr;
> size_t hdrlen;
> - u16 fc;
> int a4_included;
> u8 *pos;
>
> hdr = (struct ieee80211_hdr *) skb->data;
> - fc = le16_to_cpu(hdr->frame_control);
>
> hdrlen = 24;
> - if ((fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) ==
> - (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
> + if (ieee80211_fctl_has_a4(hdr)) {
> hdrlen += ETH_ALEN;
> + a4_included = 1;
> *sa = hdr->addr4;
> *da = hdr->addr3;
> - } else if (fc & IEEE80211_FCTL_FROMDS) {
> + } else if (ieee80211_fctl_fromds(hdr)) {
> *sa = hdr->addr3;
> *da = hdr->addr1;
> - } else if (fc & IEEE80211_FCTL_TODS) {
> + } else if (ieee80211_fctl_tods(hdr)) {
> *sa = hdr->addr2;
> *da = hdr->addr3;
> } else {
> @@ -48,16 +46,14 @@ static int ieee80211_get_hdr_info(const struct sk_buff *skb, u8 **sa, u8 **da,
> *da = hdr->addr1;
> }
>
> - if (fc & 0x80)
> + if (ieee80211_stype(hdr, IEEE80211_STYPE_QOS_DATA))
> hdrlen += 2;
>
> *data = skb->data + hdrlen;
> *data_len = skb->len - hdrlen;
>
> - a4_included = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
^^^^^^^^^^^^^^^^^^^
> - (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
> - if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA &&
> - fc & IEEE80211_STYPE_QOS_DATA) {
> + if (ieee80211_ftype_data(hdr) &&
> + ieee80211_stype(hdr, IEEE80211_STYPE_QOS_DATA)) {
> pos = (u8 *) &hdr->addr4;
> if (a4_included)
Are we going to use a4_included uninitialized now?
> pos += 6;
--
Greetings Michael.
prev parent reply other threads:[~2008-05-16 20:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 19:29 [RFC-PATCH] mac80211: add helpers for frame control tests Harvey Harrison
2008-05-16 19:38 ` Harvey Harrison
2008-05-16 20:31 ` Johannes Berg
2008-05-16 20:40 ` Johannes Berg
2008-05-16 21:04 ` Harvey Harrison
2008-05-16 21:12 ` Johannes Berg
2008-05-16 21:57 ` Harvey Harrison
2008-05-16 22:03 ` Johannes Berg
2008-05-16 23:48 ` Harvey Harrison
2008-05-17 9:12 ` Johannes Berg
2008-05-16 20:42 ` Michael Buesch [this message]
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=200805162242.28181.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=harvey.harrison@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).