diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2024-12-01 20:16:19 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2024-12-08 21:01:40 +0000 |
commit | 30e8252353d95cc77f787ef784942a551d3e0567 (patch) | |
tree | f407ed346a032eb55e9b6e326e77f61f6004f315 /sys/net80211 | |
parent | 8437d7d6a4d6827ccb78c06341c6e3d847da44dd (diff) |
net80211: HT: check for feature support in ht_recv_action_ht_txchwidth()
ht_recv_action_ht_txchwidth() can blindly change the channel width to
40 Mhz whether or not that is supported. If 20/40 is not supported
there is nothing to do as the channel width cannot change in that case.
While here mark unused arguments with __unused.
Sponosred by: The FreeBSD Foundation
MFC adter: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D47857
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_ht.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 293b5be20d32..e2506c1e0ce0 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -2595,11 +2595,15 @@ ht_recv_action_ba_delba(struct ieee80211_node *ni, static int ht_recv_action_ht_txchwidth(struct ieee80211_node *ni, - const struct ieee80211_frame *wh, - const uint8_t *frm, const uint8_t *efrm) + const struct ieee80211_frame *wh __unused, + const uint8_t *frm, const uint8_t *efrm __unused) { int chw; + /* If 20/40 is not supported the chw cannot change. */ + if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) == 0) + return (0); + chw = (frm[2] == IEEE80211_A_HT_TXCHWIDTH_2040) ? IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20; |