From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] cfg80211: Allow reassociation to be requested with internal SME
Date: Wed, 06 Apr 2016 15:09:44 +0200 [thread overview]
Message-ID: <1459948184.17504.75.camel@sipsolutions.net> (raw)
In-Reply-To: <1459248808-16412-2-git-send-email-jouni@qca.qualcomm.com>
On Tue, 2016-03-29 at 13:53 +0300, Jouni Malinen wrote:
> If the user space issues a NL80211_CMD_CONNECT with
> NL80211_ATTR_PREV_BSSID when there is already a connection, allow
> this
> to proceed as a reassociation instead of rejecting the new connect
> command with EALREADY.
>
> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
> ---
> net/wireless/nl80211.c | 3 ++-
> net/wireless/sme.c | 11 +++++++++--
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index a98665a..773b20f 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -8117,7 +8117,8 @@ static int nl80211_connect(struct sk_buff *skb,
> struct genl_info *info)
> }
>
> wdev_lock(dev->ieee80211_ptr);
> - err = cfg80211_connect(rdev, dev, &connect, connkeys, NULL);
> + err = cfg80211_connect(rdev, dev, &connect, connkeys,
> + connect.prev_bssid);
> wdev_unlock(dev->ieee80211_ptr);
> if (err)
> kzfree(connkeys);
> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
> index 65882d2..ce32492 100644
> --- a/net/wireless/sme.c
> +++ b/net/wireless/sme.c
> @@ -492,8 +492,15 @@ static int cfg80211_sme_connect(struct
> wireless_dev *wdev,
> if (!rdev->ops->auth || !rdev->ops->assoc)
> return -EOPNOTSUPP;
>
> - if (wdev->current_bss)
> - return -EALREADY;
> + if (wdev->current_bss) {
> + if (!prev_bssid)
> + return -EALREADY;
> + cfg80211_unhold_bss(wdev->current_bss);
> + cfg80211_put_bss(wdev->wiphy, &wdev->current_bss-
> >pub);
> + wdev->current_bss = NULL;
> +
> + cfg80211_sme_free(wdev);
> + }
>
Since we know the previous BSSID, I've added a check here for it.
johannes
prev parent reply other threads:[~2016-04-06 13:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-29 10:53 [PATCH 1/2] cfg80211: Add option to specify previous BSSID for Connect command Jouni Malinen
2016-03-29 10:53 ` [PATCH 2/2] cfg80211: Allow reassociation to be requested with internal SME Jouni Malinen
2016-04-06 13:09 ` Johannes Berg [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=1459948184.17504.75.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jouni@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.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).