mac80211: Give it some time to do the TSF sync
Give slow hardware some time to do the TSF sync, to not run into an
IBSS merging endless loop in some rarely situations.
Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 7a944ca..a96ce9d 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -29,6 +29,7 @@
#define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ)
#define IEEE80211_IBSS_MERGE_INTERVAL (30 * HZ)
+#define IEEE80211_IBSS_MERGE_DELAY 0x400000
#define IEEE80211_IBSS_INACTIVITY_LIMIT (60 * HZ)
#define IEEE80211_IBSS_MAX_STA_ENTRIES 128
@@ -336,6 +337,10 @@
jiffies);
#endif
+ /* give slow hardware some time to do the TSF sync */
+ if (rx_timestamp < IEEE80211_IBSS_MERGE_DELAY)
+ goto put_bss;
+
if (beacon_timestamp > rx_timestamp) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG "%s: beacon TSF higher than "