Skip to content

Commit a04564c

Browse files
committed
mac80211: consider more elements in parsing CRC
We only use the parsing CRC for checking if a beacon changed, and elements with an ID > 63 cannot be represented in the filter. Thus, like we did before with WMM and Cisco vendor elements, just statically add these forgotten items to the CRC: - WLAN_EID_VHT_OPERATION - WLAN_EID_OPMODE_NOTIF I guess that in most cases when VHT/HE operation change, the HT operation also changed, and so the change was picked up, but we did notice that pure operating mode notification changes were ignored. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/[email protected] [restrict to VHT for the mac80211 branch] Signed-off-by: Johannes Berg <[email protected]>
1 parent 2bf973f commit a04564c

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

net/mac80211/util.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,16 +1063,22 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
10631063
elem_parse_failed = true;
10641064
break;
10651065
case WLAN_EID_VHT_OPERATION:
1066-
if (elen >= sizeof(struct ieee80211_vht_operation))
1066+
if (elen >= sizeof(struct ieee80211_vht_operation)) {
10671067
elems->vht_operation = (void *)pos;
1068-
else
1069-
elem_parse_failed = true;
1068+
if (calc_crc)
1069+
crc = crc32_be(crc, pos - 2, elen + 2);
1070+
break;
1071+
}
1072+
elem_parse_failed = true;
10701073
break;
10711074
case WLAN_EID_OPMODE_NOTIF:
1072-
if (elen > 0)
1075+
if (elen > 0) {
10731076
elems->opmode_notif = pos;
1074-
else
1075-
elem_parse_failed = true;
1077+
if (calc_crc)
1078+
crc = crc32_be(crc, pos - 2, elen + 2);
1079+
break;
1080+
}
1081+
elem_parse_failed = true;
10761082
break;
10771083
case WLAN_EID_MESH_ID:
10781084
elems->mesh_id = pos;

0 commit comments

Comments
 (0)