cfg80211: fix connect/disconnect edge cases
authorJohannes Berg <johannes.berg@intel.com>
Tue, 17 Oct 2017 19:56:20 +0000 (21:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2017 08:49:15 +0000 (09:49 +0100)
commitbb46f793ad02d13e678538d204a40f77a5fa2cd2
tree1401cb5f31ac873259a31c6496fbf58f4ad99926
parent7e31cdee8b8949307e98b86b345d4ecf16525fab
cfg80211: fix connect/disconnect edge cases

commit 51e13359cd5ea34acc62c90627603352956380af upstream.

If we try to connect while already connected/connecting, but
this fails, we set ssid_len=0 but leave current_bss hanging,
leading to errors.

Check all of this better, first of all ensuring that we can't
try to connect to a different SSID while connected/ing; ensure
that prev_bssid is set for re-association attempts even in the
case of the driver supporting the connect() method, and don't
reset ssid_len in the failure cases.

While at it, also reset ssid_len while disconnecting unless we
were connected and expect a disconnected event, and warn on a
successful connection without ssid_len being set.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/sme.c