diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-24 09:15:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:38 -0400 |
commit | 16cf438a1eca2b7206bd7ac7763637c2a87c00c6 (patch) | |
tree | 2da715b1c9bb8ed4f828a340643d6bbc1a131e29 /net/mac80211/mlme.c | |
parent | d91f190c412aff940a46cabaccf114361c133605 (diff) |
mac80211: fix probe response processing
Due to the use of a _REQ_DIRECT_PROBE bit, which is
unnecessary (and I wonder why it was done that way),
an interesting situation can arise:
1) we try to probe an access point
2) the AP doesn't response in time
3) we tell userspace that we gave up
4) the AP suddenly responds
5) we auth/assoc with the AP
I've seen 4) happen in testing with hostapd SIGSTOPped,
and when SIGCONTinued it processes the probe requests
that came in and send responses. But 5) is not supposed
to happen after we tell everybody we've given up on the
AP.
To fix this, remove the _REQ_DIRECT_PROBE request bit,
and process probe responses when we're in the relevant
MLME state, namely IEEE80211_STA_MLME_DIRECT_PROBE.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 30a0034b9124..2ded4766d014 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -915,8 +915,6 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata) | |||
915 | 915 | ||
916 | ifmgd->state = IEEE80211_STA_MLME_DIRECT_PROBE; | 916 | ifmgd->state = IEEE80211_STA_MLME_DIRECT_PROBE; |
917 | 917 | ||
918 | set_bit(IEEE80211_STA_REQ_DIRECT_PROBE, &ifmgd->request); | ||
919 | |||
920 | /* Direct probe is sent to broadcast address as some APs | 918 | /* Direct probe is sent to broadcast address as some APs |
921 | * will not answer to direct packet in unassociated state. | 919 | * will not answer to direct packet in unassociated state. |
922 | */ | 920 | */ |
@@ -1738,8 +1736,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, | |||
1738 | ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, false); | 1736 | ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, false); |
1739 | 1737 | ||
1740 | /* direct probe may be part of the association flow */ | 1738 | /* direct probe may be part of the association flow */ |
1741 | if (test_and_clear_bit(IEEE80211_STA_REQ_DIRECT_PROBE, | 1739 | if (ifmgd->state == IEEE80211_STA_MLME_DIRECT_PROBE) { |
1742 | &ifmgd->request)) { | ||
1743 | printk(KERN_DEBUG "%s direct probe responded\n", | 1740 | printk(KERN_DEBUG "%s direct probe responded\n", |
1744 | sdata->dev->name); | 1741 | sdata->dev->name); |
1745 | ieee80211_authenticate(sdata); | 1742 | ieee80211_authenticate(sdata); |