[PATCH 2/2] PR: Match 6 GHz op class when resolving preferred freq
Emily Xia
xiayucheng at google.com
Wed Nov 4 00:41:13 PST 2026
In pr_get_preferred_channel(), both 5 GHz (op_class 115-130) and 6 GHz
(op_class 131-137) operating classes map to HOSTAPD_MODE_IEEE80211A.
Because channels 149-177 exist in both 5 GHz UNII-3 and 6 GHz UNII-6/7,
checking only map->mode == hw_mode allows a 6 GHz preferred_freq (e.g.
6695 MHz on channel 149) to falsely match 5 GHz op_class 128 (5745 MHz).
Verify that each candidate op_class matches is_6ghz_op_class() of the
base_op_class resolved from preferred_freq before selecting it.
Signed-off-by: Emily Xia <xiayucheng at google.com>
---
src/common/proximity_ranging.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/common/proximity_ranging.c b/src/common/proximity_ranging.c
index b7d088e63..2d66a88ac 100644
--- a/src/common/proximity_ranging.c
+++ b/src/common/proximity_ranging.c
@@ -654,6 +654,9 @@ static bool pr_get_preferred_channel(int preferred_freq,
for (j = 0; j < common_chan->op_class[i].channels; j++) {
if (common_chan->op_class[i].channel[j] != channel)
continue;
+ if (is_6ghz_op_class(common_chan->op_class[i].op_class) !=
+ is_6ghz_op_class(base_op_class))
+ break;
map = get_oper_class(NULL,
common_chan->op_class[i].op_class);
if (!map || map->mode != hw_mode)
--
2.56.0.385.gac671c819a-goog
More information about the Hostap
mailing list