From: David Spinadel Date: Tue, 17 Mar 2015 17:58:38 +0000 (+0200) Subject: mac80211: stop scan before connection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d830a198689bd33057923e0370147d43241c7f0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mac80211: stop scan before connection Stop scan before authentication or association to make sure that nothing interferes with connection flow. Currently mac80211 defers RX auth and assoc packets (among other ones) until after the scan is complete, so auth during scan is likely to fail if scan took too much time. Signed-off-by: David Spinadel Reviewed-by: Luciano Coelho Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 22b125913661..4a01a836f870 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4439,6 +4439,10 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, } else WARN_ON_ONCE(!ether_addr_equal(ifmgd->bssid, cbss->bssid)); + /* Cancel scan to ensure that nothing interferes with connection */ + if (local->scanning) + ieee80211_scan_cancel(local); + return 0; }