Skip to content

Commit

Permalink
mac80211: consider more elements in parsing CRC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Feb 7, 2020
1 parent 2bf973f commit a04564c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions net/mac80211/util.c
Original file line number Diff line number Diff line change
@@ -1063,16 +1063,22 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
elem_parse_failed = true;
break;
case WLAN_EID_VHT_OPERATION:
if (elen >= sizeof(struct ieee80211_vht_operation))
if (elen >= sizeof(struct ieee80211_vht_operation)) {
elems->vht_operation = (void *)pos;
else
elem_parse_failed = true;
if (calc_crc)
crc = crc32_be(crc, pos - 2, elen + 2);
break;
}
elem_parse_failed = true;
break;
case WLAN_EID_OPMODE_NOTIF:
if (elen > 0)
if (elen > 0) {
elems->opmode_notif = pos;
else
elem_parse_failed = true;
if (calc_crc)
crc = crc32_be(crc, pos - 2, elen + 2);
break;
}
elem_parse_failed = true;
break;
case WLAN_EID_MESH_ID:
elems->mesh_id = pos;

0 comments on commit a04564c

Please sign in to comment.