Skip to content

Commit

Permalink
cfg80211: allow aborting in-progress connection atttempts
Browse files Browse the repository at this point in the history
On a disconnect request from userspace, cfg80211 currently calls
called rdev_disconnect() only in case that 'current_bss' was set,
i.e. connection had been established.

Change this to allow the userspace call to succeed and call the
driver's disconnect() method also while the connection attempt is
in progress, to be able to abort attempts.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
[change commit subject/message]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
ilanpeer2 authored and jmberg-intel committed Oct 19, 2016
1 parent f438ceb commit 0711d63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2564,9 +2564,10 @@ struct cfg80211_nan_func {
* cases, the result of roaming is indicated with a call to
* cfg80211_roamed() or cfg80211_roamed_bss().
* (invoked with the wireless_dev mutex held)
* @disconnect: Disconnect from the BSS/ESS. Once done, call
* cfg80211_disconnected().
* (invoked with the wireless_dev mutex held)
* @disconnect: Disconnect from the BSS/ESS or stop connection attempts if
* connection is in progress. Once done, call cfg80211_disconnected() in
* case connection was already established (invoked with the
* wireless_dev mutex held), otherwise call cfg80211_connect_timeout().
*
* @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
* cfg80211_ibss_joined(), also call that function when changing BSSID due
Expand Down
2 changes: 1 addition & 1 deletion net/wireless/sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
err = cfg80211_sme_disconnect(wdev, reason);
else if (!rdev->ops->disconnect)
cfg80211_mlme_down(rdev, dev);
else if (wdev->current_bss)
else if (wdev->ssid_len)
err = rdev_disconnect(rdev, dev, reason);

return err;
Expand Down

0 comments on commit 0711d63

Please sign in to comment.