Skip to contentSkip to conversation

wpa_supplicant: Handle invalid op_class 255 in BSS Transition candidates

PATCH Superseded Wei Zhang 3 participants 6 messages May 26 – Jun 3

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Zhang

author
#0 lore raw

PATCH 1/1 wpa_supplicant: Handle invalid op_class 255 in BSS Transition candidates

Some APs provide invalid operating class (e.g. 255) in BSS Transition Management Requests. Fall back to deriving the band from the channel number.

Without this workaround, invalid op_class values may trigger unnecessary full scans and degrade roaming behavior with non-compliant APs. Standard-compliant cases remain unchanged.

---
 ...r-broken-AP-operating-class-behavior.patch | 39 +++++++++++++++++++
 .../wpa-supplicant/wpa-supplicant_2.11.bb     |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-WNM-Extend-workaround-for-broken-AP-operating-class-behavior.patch
meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-WNM-Extend-workaround-for-broken-AP-operating-class-behavior.patch new file +39 -0
new file mode 100644
index 0000000000..47fe1b4c9f
@@ -0,0 +1,39 @@
+From 72ac0ee026d9f6f9cd031d7859ea0b343b34e61d Mon Sep 17 00:00:00 2001
+From: "Yu Zhang(Yuriy)" <[email protected]>
+Date: Thu, 1 Aug 2024 18:37:25 +0800
+Subject: [PATCH] WNM: Extend workaround for broken AP operating class behavior
+
+Some APs do not advertise operating classes correctly for BSS Transition
+Management. Try to determine the most likely operating frequency based
+on the channel number (1..14 --> 2.4 GHz; 36..177 --> 5 GHz) if invalid
+op_class == 255 is received in a BSS Transition Management Request. This
+speeds up the following operating by avoiding a full scan due to an
+unknown channel.
+
+This extends the workaround that was added in commit 80ce804e8824 ("WNM:
+Workaround for broken AP operating class behavior") for invalid
+operating class 0 to cover another observed case with invalid operating
+class 255.
+
+Signed-off-by: Yu Zhang(Yuriy) <[email protected]>
+Upstream-Status: Backport [https://w1.fi/cgit/hostap.git/commit/?id=72ac0ee026d9f6f9cd031d7859ea0b343b34e61d]
+---
+ wpa_supplicant/wnm_sta.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
+index 58a124c00..662f6089e 100644
+--- a/wpa_supplicant/wnm_sta.c
++++ b/wpa_supplicant/wnm_sta.c
+@@ -555,7 +555,7 @@ static int wnm_nei_get_chan(struct wpa_supplicant *wpa_s, u8 op_class, u8 chan)
+ 	}
+ 
+ 	freq = ieee80211_chan_to_freq(country, op_class, chan);
+-	if (freq <= 0 && op_class == 0) {
++	if (freq <= 0 && (op_class == 0 || op_class == 255)) {
+ 		/*
+ 		 * Some APs do not advertise correct operating class
+ 		 * information. Try to determine the most likely operating
+-- 
+2.34.1
+
meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.11.bb +1 -0
index 32ecf41406..558065f03a 100644
@@ -19,6 +19,7 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
            file://0002-defconfig-Update-Opportunistic-Wireless-Encryption-O.patch \
            file://0003-defconfig-Document-IEEE-802.11be-as-a-published-amen.patch \
            file://0004-defconfig-Uncomment-CONFIG_IEEE80211BE-y.patch \
+           file://0005-WNM-Extend-workaround-for-broken-AP-operating-class-behavior.patch \
            file://CVE-2025-24912-01.patch \
            file://CVE-2025-24912-02.patch \
            "
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Zhang

Some APs provide invalid operating class (e.g. 255) in BSS Transition Management Requests. Fall back to deriving the band from the channel number.

Without this workaround, invalid op_class values may trigger unnecessary full scans and degrade roaming behavior with non-compliant APs. Standard-compliant cases remain unchanged.

Quoted 7 lines
---
 ...r-broken-AP-operating-class-behavior.patch | 39 +++++++++++++++++++
 .../wpa-supplicant/wpa-supplicant_2.11.bb     |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-WNM-Extend-workaround-for-broken-AP-operating-class-behavior.patch

The same question. Which branches does it need to be backported to?

Signature · 2 lines
With best wishes
Dmitry
#2 lore raw
Quoted 3 lines · Dmitry Baryshkov via lists.openembedded.org

The same question. Which branches does it need to be backported to?

Wait. This ever-increasing mass of backports coming from Qualcomm isn't great.

You need to engage with wpa-supplicant upstream (which also works for Qualcomm), and try to convince them to make a new release (and make releases more frequently). This was previously requested, but wasn't acknowledged or acted on, so I have to press you again to do it. You are in the same company, so it's not difficult.

Alex

#3 lore raw
Quoted 8 lines · Alexander Kanavin
Quoted 3 lines · Dmitry Baryshkov via lists.openembedded.org

The same question. Which branches does it need to be backported to?

Wait. This ever-increasing mass of backports coming from Qualcomm isn't great.

Quoted 7 lines

You need to engage with wpa-supplicant upstream (which also works for Qualcomm), and try to convince them to make a new release (and make releases more frequently). This was previously requested, but wasn't acknowledged or acted on, so I have to press you again to do it. You are in the same company, so it's not difficult.

Alex

Thanks for the feedback.

I agree that improving the upstream release cadence would help reduce these backports.

CC’ing Jouni here to get guidance on the release plan.

Jouni, could you please advise:
- whether a new release is planned soon, and
- how fixes like this should be handled before an official release ?

From our side, we can also help coordinate or prepare any updates if needed.

Thanks,
Wei Zhang

#4 lore raw

Hi Alex,

I followed up with Jouni on the hostap/wpa_supplicant release plan.

He confirmed that there is no clear timeline for a formal release. His recommendation is not to depend on upstream releases, but instead to pull a “snapshot of the day” from the hostap.git main branch when an update is needed.

Given this upstream guidance, would OE-Core be open to consuming the required post-2.11 fixes through such a hostap.git snapshot-based update, rather than waiting for a new formal release?

Thanks,
Wei

Quoted 31 lines · Wei Zhang (Stone)
Quoted 8 lines · Alexander Kanavin
Quoted 3 lines · Dmitry Baryshkov via lists.openembedded.org

The same question. Which branches does it need to be backported to?

Wait. This ever-increasing mass of backports coming from Qualcomm isn't great.

Quoted 7 lines

You need to engage with wpa-supplicant upstream (which also works for Qualcomm), and try to convince them to make a new release (and make releases more frequently). This was previously requested, but wasn't acknowledged or acted on, so I have to press you again to do it. You are in the same company, so it's not difficult.

Alex

Thanks for the feedback.

I agree that improving the upstream release cadence would help reduce these backports.

CC’ing Jouni here to get guidance on the release plan.

Jouni, could you please advise:
- whether a new release is planned soon, and
- how fixes like this should be handled before an official release ?

From our side, we can also help coordinate or prepare any updates if needed.

Thanks,
Wei Zhang

#5 lore raw
Quoted 8 lines · Wei Zhang (Stone)

I followed up with Jouni on the hostap/wpa_supplicant release plan.

He confirmed that there is no clear timeline for a formal release. His recommendation is not to
depend on upstream releases, but instead to pull a “snapshot of the day” from the hostap.git main
branch when an update is needed.

Quoted 4 lines

Given this upstream guidance, would OE-Core be open to consuming the required post-2.11 fixes
through such a hostap.git snapshot-based update, rather than waiting for a new formal release?

Yes, but very reluctantly. It's not a great idea to ship a random snapshot in the middle of development cycle: such code is less tested, less stable, may contain recent, unfixed bugs, incomplete features or API, and so on.

What's the point of even making formal upstream releases if downstreams are not using them? Who is the target audience for that?

Alex