Skip to content

Commit e1e6ebf

Browse files
committed
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: 5023b14 ("mac80211: support profile split between elements") Reported-by: Michael-CY Lee <[email protected]> Link: https://patch.msgid.link/20250630154501.f26cd45a0ecd.I28e0525d06e8a99e555707301bca29265cf20dc8@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 8af596e commit e1e6ebf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/mac80211/parse.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,6 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
758758
{
759759
const struct element *elem, *sub;
760760
size_t profile_len = 0;
761-
bool found = false;
762761

763762
if (!bss || !bss->transmitted_bss)
764763
return profile_len;
@@ -809,15 +808,14 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
809808
index[2],
810809
new_bssid);
811810
if (ether_addr_equal(new_bssid, bss->bssid)) {
812-
found = true;
813811
elems->bssid_index_len = index[1];
814812
elems->bssid_index = (void *)&index[2];
815-
break;
813+
return profile_len;
816814
}
817815
}
818816
}
819817

820-
return found ? profile_len : 0;
818+
return 0;
821819
}
822820

823821
static void

0 commit comments

Comments
 (0)