History

mac80211: avoid processing non-S1G elements on S1G band

In ieee80211_determine_chantype(), the sband->ht_cap was being processed before S1G Operation element. Since the HT capability element should not be present on the S1G band, avoid processing potential garbage by moving the call to ieee80211_apply_htcap_overrides() to after the S1G block. Also, in case of a missing S1G Operation element, we would continue trying to process non-S1G elements (and return with a channel width of 20MHz). Instead, just assume primary channel is equal to operating and infer the operating width from the BSS channel, then return.

Thomas Pedersen committed 6 years ago

Commit 75f87ea1 parent ab10c221 file · +9 −6Browse files

Unified · Split

net/mac80211/mlme.c+9−6
@@ -172,13 +172,13 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 171 unmodified lines
172 ret = 0;172 ret = 0;
173 vht_chandef = *chandef;173 vht_chandef = *chandef;
174 goto out;174 goto out;
175 }175 } else if (sband->band == NL80211_BAND_S1GHZ) {
176 176 if (!ieee80211_chandef_s1g_oper(s1g_oper, chandef)) {
177 memcpy(&sta_ht_cap, &sband->ht_cap, sizeof(sta_ht_cap));177 sdata_info(sdata,
178 ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);178 "Missing S1G Operation Element? Trying operating == primary\n");
179 chandef->width = ieee80211_s1g_channel_width(channel);
180 }
179 181
180 if (s1g_oper && sband->band == NL80211_BAND_S1GHZ) {
181 ieee80211_chandef_s1g_oper(s1g_oper, chandef);
182 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_40MHZ |182 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_40MHZ |
183 IEEE80211_STA_DISABLE_VHT |183 IEEE80211_STA_DISABLE_VHT |
184 IEEE80211_STA_DISABLE_80P80MHZ |184 IEEE80211_STA_DISABLE_80P80MHZ |
@@ -186,6 +186,9 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
186 goto out;186 goto out;
187 }187 }
188 188
189 memcpy(&sta_ht_cap, &sband->ht_cap, sizeof(sta_ht_cap));
190 ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
191
189 if (!ht_oper || !sta_ht_cap.ht_supported) {192 if (!ht_oper || !sta_ht_cap.ht_supported) {
190 ret = IEEE80211_STA_DISABLE_HT |193 ret = IEEE80211_STA_DISABLE_HT |
191 IEEE80211_STA_DISABLE_VHT |194 IEEE80211_STA_DISABLE_VHT |

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t