diff mbox series

[3/5] band: check the operating class band before checking e4

Message ID 20241024164635.176631-3-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/5] band: correct oper class 136 starting frequency | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Oct. 24, 2024, 4:46 p.m. UTC
After the band is established we check the e4 table for the channel
that matches. The problem here is we will end up checking all the
operating classes, even those that are not within the band that was
determined. This could result in false positives and return a
channel that doesn't make sense.
---
 src/band.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/src/band.c b/src/band.c
index 4e8eb9b0..09b2d932 100644
--- a/src/band.c
+++ b/src/band.c
@@ -1352,6 +1352,10 @@  check_e4:
 		const struct operating_class_info *info =
 						&e4_operating_classes[i];
 
+		if (band != band_oper_class_to_band(NULL,
+							info->operating_class))
+			continue;
+
 		if (e4_has_frequency(info, freq) == 0 ||
 					e4_has_ccfi(info, freq) == 0) {
 			if (out_band)