Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20200131111300.891737-22-luca@coelho.fi
[restrict to VHT for the mac80211 branch]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+12 -6
+12 -6
net/mac80211/util.c
··· 1063 1063 elem_parse_failed = true; 1064 1064 break; 1065 1065 case WLAN_EID_VHT_OPERATION: 1066 - if (elen >= sizeof(struct ieee80211_vht_operation)) 1066 + if (elen >= sizeof(struct ieee80211_vht_operation)) { 1067 1067 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; 1070 1073 break; 1071 1074 case WLAN_EID_OPMODE_NOTIF: 1072 - if (elen > 0) 1075 + if (elen > 0) { 1073 1076 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; 1076 1082 break; 1077 1083 case WLAN_EID_MESH_ID: 1078 1084 elems->mesh_id = pos;