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 <[email protected]>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to