From: Sujith Date: Mon, 2 Nov 2009 07:03:23 +0000 (+0530) Subject: mac80211: Fix IBSS merge X-Git-Tag: v2.6.33-rc1~388^2~449^2~53 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=450aae3d7b60a970f266349a837dfb30a539198b;p=~shefty%2Frdma-dev.git mac80211: Fix IBSS merge Currently, in IBSS mode, a single creator would go into a loop trying to merge/scan. This happens because the IBSS timer is rearmed on finishing a scan and the subsequent timer invocation requests another scan immediately. This patch fixes this issue by checking if we have just completed a scan run trying to merge with other IBSS networks. Signed-off-by: Sujith Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index ca8ecce31d3..6ae288387a1 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -453,6 +453,10 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) ieee80211_sta_expire(sdata, IEEE80211_IBSS_INACTIVITY_LIMIT); + if (time_before(jiffies, ifibss->last_scan_completed + + IEEE80211_IBSS_MERGE_INTERVAL)) + return; + if (ieee80211_sta_active_ibss(sdata)) return;