mac80211: respond to beacon loss report only once
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 12 May 2009 17:58:12 +0000 (19:58 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 13 May 2009 19:44:42 +0000 (15:44 -0400)
The driver might keep reporting beacon loss until we
disassociate -- catch that and don't respond to any
subsequent events until the probe is either successful
or we disassociate.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c

index 2806f6af7ae7676e081cf5e197c8456f5deac4fa..7835e7d432408ace2543e3edbf9792e5b1336f39 100644 (file)
@@ -1182,6 +1182,17 @@ void ieee80211_beacon_loss_work(struct work_struct *work)
                             u.mgd.beacon_loss_work);
        struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 
+       /*
+        * The driver has already reported this event and we have
+        * already sent a probe request. Maybe the AP died and the
+        * driver keeps reporting until we disassociate... We have
+        * to ignore that because otherwise we would continually
+        * reset the timer and never check whether we received a
+        * probe response!
+        */
+       if (ifmgd->flags & IEEE80211_STA_PROBEREQ_POLL)
+               return;
+
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
        if (net_ratelimit()) {
                printk(KERN_DEBUG "%s: driver reports beacon loss from AP %pM "