Skip to content

Commit 188f60a

Browse files
bcopelandjmberg-intel
authored andcommitted
nl80211: relax ht operation checks for mesh
Commit 9757235, "nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value") relaxed the range for the HT operation field in meshconf, while also adding checks requiring the non-greenfield and non-ht-sta bits to be set in certain circumstances. The latter bit is actually reserved for mesh BSSes according to Table 9-168 in 802.11-2016, so in fact it should not be set. wpa_supplicant sets these bits because the mesh and AP code share the same implementation, but authsae does not. As a result, some meshconf updates from authsae which set only the NONHT_MIXED protection bits were being rejected. In order to avoid breaking userspace by changing the rules again, simply accept the values with or without the bits set, and mask off the reserved bit to match the spec. While in here, update the 802.11-2012 reference to 802.11-2016. Fixes: 9757235 ("nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value") Cc: Masashi Honma <[email protected]> Signed-off-by: Bob Copeland <[email protected]> Reviewed-by: Masashi Honma <[email protected]> Reviewed-by: Masashi Honma <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent e7441c9 commit 188f60a

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

net/wireless/nl80211.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6231,7 +6231,7 @@ do { \
62316231
nl80211_check_s32);
62326232
/*
62336233
* Check HT operation mode based on
6234-
* IEEE 802.11 2012 8.4.2.59 HT Operation element.
6234+
* IEEE 802.11-2016 9.4.2.57 HT Operation element.
62356235
*/
62366236
if (tb[NL80211_MESHCONF_HT_OPMODE]) {
62376237
ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]);
@@ -6241,22 +6241,9 @@ do { \
62416241
IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
62426242
return -EINVAL;
62436243

6244-
if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) &&
6245-
(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
6246-
return -EINVAL;
6244+
/* NON_HT_STA bit is reserved, but some programs set it */
6245+
ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
62476246

6248-
switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) {
6249-
case IEEE80211_HT_OP_MODE_PROTECTION_NONE:
6250-
case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ:
6251-
if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)
6252-
return -EINVAL;
6253-
break;
6254-
case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER:
6255-
case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED:
6256-
if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
6257-
return -EINVAL;
6258-
break;
6259-
}
62606247
cfg->ht_opmode = ht_opmode;
62616248
mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1));
62626249
}

0 commit comments

Comments
 (0)