]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/mac80211-send-last-3-5-probe-requests-as-unicast.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / mac80211-send-last-3-5-probe-requests-as-unicast.patch
1 From f01a067d9e4598c71e3c9ee3a84859d2e8af4f8e Mon Sep 17 00:00:00 2001
2 From: Luis R. Rodriguez <lrodriguez@atheros.com>
3 Date: Thu, 16 Sep 2010 15:12:34 -0400
4 Subject: mac80211: send last 3/5 probe requests as unicast
5
6 From: Luis R. Rodriguez <lrodriguez@atheros.com>
7
8 commit f01a067d9e4598c71e3c9ee3a84859d2e8af4f8e upstream.
9
10 Some buggy APs do not respond to unicast probe requests
11 or send unicast probe requests very delayed so in the
12 worst case we should try to send broadcast probe requests,
13 otherwise we can get disconnected from these APs.
14
15 Even if drivers do not have filters to disregard probe
16 responses from foreign APs mac80211 will only process
17 probe responses from our associated AP for re-arming
18 connection monitoring.
19
20 We need to do this since the beacon monitor does not
21 push back the connection monitor by design so even if we
22 are getting beacons from these type of APs our connection
23 monitor currently relies heavily on the way the probe
24 requests are received on the AP. An example of an AP
25 affected by this is the Nexus One, but this has also been
26 observed with random APs.
27
28 We can probably optimize this later by using null funcs
29 instead of probe requests.
30
31 For more details refer to:
32
33 http://code.google.com/p/chromium-os/issues/detail?id=5715
34
35 This patch has fixes for stable kernels [2.6.35+].
36
37 Cc: Paul Stewart <pstew@google.com>
38 Cc: Amod Bodas <amod.bodas@atheros.com>
39 Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
40 Signed-off-by: John W. Linville <linville@tuxdriver.com>
41 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
42
43 ---
44 net/mac80211/mlme.c | 13 +++++++++++--
45 1 file changed, 11 insertions(+), 2 deletions(-)
46
47 --- a/net/mac80211/mlme.c
48 +++ b/net/mac80211/mlme.c
49 @@ -1022,10 +1022,19 @@ static void ieee80211_mgd_probe_ap_send(
50 {
51 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
52 const u8 *ssid;
53 + u8 *dst = ifmgd->associated->bssid;
54 + u8 unicast_limit = max(1, IEEE80211_MAX_PROBE_TRIES - 3);
55 +
56 + /*
57 + * Try sending broadcast probe requests for the last three
58 + * probe requests after the first ones failed since some
59 + * buggy APs only support broadcast probe requests.
60 + */
61 + if (ifmgd->probe_send_count >= unicast_limit)
62 + dst = NULL;
63
64 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
65 - ieee80211_send_probe_req(sdata, ifmgd->associated->bssid,
66 - ssid + 2, ssid[1], NULL, 0);
67 + ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0);
68
69 ifmgd->probe_send_count++;
70 ifmgd->probe_timeout = jiffies + IEEE80211_PROBE_WAIT;