diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2025-06-30 15:45:01 +0200 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-07-07 10:42:48 +0200 |
| commit | e1e6ebf490e55fee1ae573aa443c1d4aea5e4a40 (patch) | |
| tree | c0ecd3ea0be4deb50e53bd78c9a80e113ed6801e /net | |
| parent | 8af596e8ae44c3bcf36d1aea09fc9a6f17c555e5 (diff) | |
wifi: mac80211: fix non-transmitted BSSID profile search
When the non-transmitted BSSID profile is found, immediately return
from the search to not return the wrong profile_len when the profile
is found in a multiple BSSID element that isn't the last one in the
frame.
Fixes: 5023b14cf4df ("mac80211: support profile split between elements")
Reported-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Link: https://patch.msgid.link/20250630154501.f26cd45a0ecd.I28e0525d06e8a99e555707301bca29265cf20dc8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/mac80211/parse.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c index 96584b39215e..c5e0f7f46004 100644 --- a/net/mac80211/parse.c +++ b/net/mac80211/parse.c @@ -758,7 +758,6 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, { const struct element *elem, *sub; size_t profile_len = 0; - bool found = false; if (!bss || !bss->transmitted_bss) return profile_len; @@ -809,15 +808,14 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, index[2], new_bssid); if (ether_addr_equal(new_bssid, bss->bssid)) { - found = true; elems->bssid_index_len = index[1]; elems->bssid_index = (void *)&index[2]; - break; + return profile_len; } } } - return found ? profile_len : 0; + return 0; } static void |
