diff options
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 2b1f1f3d6a58..a9d40584e383 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -84,7 +84,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
84 | { | 84 | { |
85 | struct cfg80211_bss *cbss; | 85 | struct cfg80211_bss *cbss; |
86 | struct ieee80211_bss *bss; | 86 | struct ieee80211_bss *bss; |
87 | int clen; | 87 | int clen, srlen; |
88 | s32 signal = 0; | 88 | s32 signal = 0; |
89 | 89 | ||
90 | if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) | 90 | if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) |
@@ -113,23 +113,24 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
113 | bss->dtim_period = tim_ie->dtim_period; | 113 | bss->dtim_period = tim_ie->dtim_period; |
114 | } | 114 | } |
115 | 115 | ||
116 | bss->supp_rates_len = 0; | 116 | /* replace old supported rates if we get new values */ |
117 | srlen = 0; | ||
117 | if (elems->supp_rates) { | 118 | if (elems->supp_rates) { |
118 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 119 | clen = IEEE80211_MAX_SUPP_RATES; |
119 | if (clen > elems->supp_rates_len) | 120 | if (clen > elems->supp_rates_len) |
120 | clen = elems->supp_rates_len; | 121 | clen = elems->supp_rates_len; |
121 | memcpy(&bss->supp_rates[bss->supp_rates_len], elems->supp_rates, | 122 | memcpy(bss->supp_rates, elems->supp_rates, clen); |
122 | clen); | 123 | srlen += clen; |
123 | bss->supp_rates_len += clen; | ||
124 | } | 124 | } |
125 | if (elems->ext_supp_rates) { | 125 | if (elems->ext_supp_rates) { |
126 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 126 | clen = IEEE80211_MAX_SUPP_RATES - srlen; |
127 | if (clen > elems->ext_supp_rates_len) | 127 | if (clen > elems->ext_supp_rates_len) |
128 | clen = elems->ext_supp_rates_len; | 128 | clen = elems->ext_supp_rates_len; |
129 | memcpy(&bss->supp_rates[bss->supp_rates_len], | 129 | memcpy(bss->supp_rates + srlen, elems->ext_supp_rates, clen); |
130 | elems->ext_supp_rates, clen); | 130 | srlen += clen; |
131 | bss->supp_rates_len += clen; | ||
132 | } | 131 | } |
132 | if (srlen) | ||
133 | bss->supp_rates_len = srlen; | ||
133 | 134 | ||
134 | bss->wmm_used = elems->wmm_param || elems->wmm_info; | 135 | bss->wmm_used = elems->wmm_param || elems->wmm_info; |
135 | bss->uapsd_supported = is_uapsd_supported(elems); | 136 | bss->uapsd_supported = is_uapsd_supported(elems); |