aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlina Friedrichsen <x-alina@gmx.net>2009-01-29 07:56:20 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-09 15:03:40 -0500
commitc4e3a5844812dd5bf03282e021175d55d608f594 (patch)
tree9abe70bd77754ec2e0b29e0bc2019e19d341a3ee
parentf2bffa7ea012befc2230331f97bf9b002c0b62bb (diff)
mac80211: IBSS join rework
I hold back this patch for around a week to avoid confusion. This is the second step of "mac80211: Fixed BSSID handling revisited". With it, in the situation of a strange merge to the same BSSID (e.g. caused by a TSF overflow) only reset_tsf() is called. And sta_info_flush_delayed() is only called if you change the network manually, not on an automatic BSSID merge. Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/mlme.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0ece151659c..73808780f53 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1503,13 +1503,22 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
1503 struct ieee80211_bss *bss) 1503 struct ieee80211_bss *bss)
1504{ 1504{
1505 struct ieee80211_local *local = sdata->local; 1505 struct ieee80211_local *local = sdata->local;
1506 int res, rates, i, j; 1506 int res = 0, rates, i, j;
1507 struct sk_buff *skb; 1507 struct sk_buff *skb;
1508 struct ieee80211_mgmt *mgmt; 1508 struct ieee80211_mgmt *mgmt;
1509 u8 *pos; 1509 u8 *pos;
1510 struct ieee80211_supported_band *sband; 1510 struct ieee80211_supported_band *sband;
1511 union iwreq_data wrqu; 1511 union iwreq_data wrqu;
1512 1512
1513 if (local->ops->reset_tsf) {
1514 /* Reset own TSF to allow time synchronization work. */
1515 local->ops->reset_tsf(local_to_hw(local));
1516 }
1517
1518 if ((ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) &&
1519 memcmp(ifsta->bssid, bss->bssid, ETH_ALEN) == 0)
1520 return res;
1521
1513 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 + 1522 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 +
1514 sdata->u.sta.ie_proberesp_len); 1523 sdata->u.sta.ie_proberesp_len);
1515 if (!skb) { 1524 if (!skb) {
@@ -1520,13 +1529,11 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
1520 1529
1521 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 1530 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
1522 1531
1523 /* Remove possible STA entries from other IBSS networks. */ 1532 if (!(ifsta->flags & IEEE80211_STA_PREV_BSSID_SET)) {
1524 sta_info_flush_delayed(sdata); 1533 /* Remove possible STA entries from other IBSS networks. */
1525 1534 sta_info_flush_delayed(sdata);
1526 if (local->ops->reset_tsf) {
1527 /* Reset own TSF to allow time synchronization work. */
1528 local->ops->reset_tsf(local_to_hw(local));
1529 } 1535 }
1536
1530 memcpy(ifsta->bssid, bss->bssid, ETH_ALEN); 1537 memcpy(ifsta->bssid, bss->bssid, ETH_ALEN);
1531 res = ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID); 1538 res = ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID);
1532 if (res) 1539 if (res)