Skip to content

Commit 19aa842

Browse files
ilanpeer2jmberg-intel
authored andcommitted
wifi: mac80211: Fix common size calculation for ML element
When the ML type is EPCS the control bitmap is reserved, the length is always 7 and is captured by the 1st octet after the control. Fixes: 0f48b8b ("wifi: ieee80211: add definitions for multi-link element") Signed-off-by: Ilan Peer <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250102161730.5790376754a7.I381208cbb72b1be2a88239509294099e9337e254@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 904c277 commit 19aa842

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

include/linux/ieee80211.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,28 +5084,24 @@ static inline u8 ieee80211_mle_common_size(const u8 *data)
50845084
{
50855085
const struct ieee80211_multi_link_elem *mle = (const void *)data;
50865086
u16 control = le16_to_cpu(mle->control);
5087-
u8 common = 0;
50885087

50895088
switch (u16_get_bits(control, IEEE80211_ML_CONTROL_TYPE)) {
50905089
case IEEE80211_ML_CONTROL_TYPE_BASIC:
50915090
case IEEE80211_ML_CONTROL_TYPE_PREQ:
50925091
case IEEE80211_ML_CONTROL_TYPE_TDLS:
50935092
case IEEE80211_ML_CONTROL_TYPE_RECONF:
5093+
case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
50945094
/*
50955095
* The length is the first octet pointed by mle->variable so no
50965096
* need to add anything
50975097
*/
50985098
break;
5099-
case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
5100-
if (control & IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR)
5101-
common += ETH_ALEN;
5102-
return common;
51035099
default:
51045100
WARN_ON(1);
51055101
return 0;
51065102
}
51075103

5108-
return sizeof(*mle) + common + mle->variable[0];
5104+
return sizeof(*mle) + mle->variable[0];
51095105
}
51105106

51115107
/**
@@ -5392,8 +5388,7 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len)
53925388
check_common_len = true;
53935389
break;
53945390
case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
5395-
if (control & IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR)
5396-
common += ETH_ALEN;
5391+
common = ETH_ALEN + 1;
53975392
break;
53985393
default:
53995394
/* we don't know this type */

0 commit comments

Comments
 (0)