OSDN Git Service

cfg80211: fix connect/disconnect edge cases
authorJohannes Berg <johannes.berg@intel.com>
Tue, 17 Oct 2017 19:56:20 +0000 (21:56 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 18 Oct 2017 07:39:44 +0000 (09:39 +0200)
commit51e13359cd5ea34acc62c90627603352956380af
tree1e31a3a0e4d5aed3ec1552351990686b1d6b951a
parent2bdd713b92a9cade239d3c7d15205a09f556624d
cfg80211: fix connect/disconnect edge cases

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.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/sme.c