diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 0ece151659c0..73808780f538 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) |