diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2023-10-27 20:41:43 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2023-11-03 21:08:03 +0000 |
commit | 78ca45df310563ca46448a124674e0542aab2e31 (patch) | |
tree | e281501ca77c2eae7a450aa92827b3013c8efd0c | |
parent | 5856761fd5f675c3871a82effdbf714a1d1bcc5e (diff) | |
download | src-78ca45df310563ca46448a124674e0542aab2e31.tar.gz src-78ca45df310563ca46448a124674e0542aab2e31.zip |
LinuxKPI: 802.11: deal with scan_ie_len
We only need to reserve the extra space for DSSS if
NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES is set, so add the conditional.
Also add checks in case scan_ie_len will grow beyond the maximum.
Given this is currently unlikely, leave the cleanup for later as
some other restructuring should be done first.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D42425
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_80211.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index aba7e0e961a6..ffda3c5693cd 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3919,20 +3919,30 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_ie_len = 2 + IEEE80211_RATE_SIZE; if (lhw->max_rates > IEEE80211_RATE_SIZE) lhw->scan_ie_len += 2 + (lhw->max_rates - IEEE80211_RATE_SIZE); - /* - * net80211 does not seem to support the DSSS Parameter Set but some of - * the drivers insert it so calculate the extra fixed space in. - */ - lhw->scan_ie_len += 2 + 1; + + if (hw->wiphy->features & NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) { + /* + * net80211 does not seem to support the DSSS Parameter Set but + * some of the drivers insert it so calculate the extra fixed + * space in. + */ + lhw->scan_ie_len += 2 + 1; + } /* Reduce the max_scan_ie_len "left" by the amount we consume already. */ - if (hw->wiphy->max_scan_ie_len > 0) + if (hw->wiphy->max_scan_ie_len > 0) { + if (lhw->scan_ie_len > hw->wiphy->max_scan_ie_len) + goto err; hw->wiphy->max_scan_ie_len -= lhw->scan_ie_len; + } if (bootverbose) ieee80211_announce(ic); return (0); +err: + IMPROVE("TODO FIXME CLEANUP"); + return (-EAGAIN); } void |