From: Johannes Berg <johannes@sipsolutions.net>
To: Antonio Quartulli <ordex@autistici.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211: in IBSS use the Auth frame to trigger STA reinsertion
Date: Thu, 12 Jan 2012 21:50:51 +0100 [thread overview]
Message-ID: <1326401451.3463.11.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1326400616-1109-2-git-send-email-ordex@autistici.org>
On Thu, 2012-01-12 at 21:36 +0100, Antonio Quartulli wrote:
> +static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
> + struct ieee80211_mgmt *mgmt,
> + size_t len)
> +{
> + u16 auth_alg, auth_transaction;
> + size_t baselen;
> +
> + lockdep_assert_held(&sdata->u.ibss.mtx);
> +
> + if (len < 24 + 6)
> + return;
> +
> + baselen = (u8 *) mgmt->u.auth.variable - (u8 *) mgmt;
> + if (baselen > len)
> + return;
> +
> + auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg);
> + auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
> +
> + if (auth_alg == WLAN_AUTH_OPEN && auth_transaction == 1) {
negating & return would be easier to read & less indentation
> +#ifdef CONFIG_MAC80211_IBSS_DEBUG
> + printk(KERN_DEBUG "%s: RX Auth SA=%pM DA=%pM BSSID=%pM."
> + "(auth_transaction=%d)\n",
> + sdata->name, mgmt->sa, mgmt->da, mgmt->bssid,
> + auth_transaction);
> +#endif
> + if (sta_info_destroy_addr(sdata, mgmt->sa) != -ENOENT) {
> + ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0,
> + false);
> + rcu_read_unlock();
> + }
This doesn't seem to make sense, why not add the station even if we
didn't know about it before?
johannes
next prev parent reply other threads:[~2012-01-12 20:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 20:36 [PATCH 1/2] mac80211: send the Auth frame in IBSS Antonio Quartulli
2012-01-12 20:36 ` [PATCH 2/2] mac80211: in IBSS use the Auth frame to trigger STA reinsertion Antonio Quartulli
2012-01-12 20:50 ` Johannes Berg [this message]
2012-01-12 21:37 ` Antonio Quartulli
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=1326401451.3463.11.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=ordex@autistici.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).