diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-12-15 11:03:12 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-12-19 09:39:01 +0100 |
commit | efc38dd7d5fa5c8cdd0c917c5d00947aa0539443 (patch) | |
tree | e7fbb0034f47b241c21eb1f23fdc1ccb569d8c1b /net/mac80211/rx.c | |
parent | dc7eb0f2c23f58bc0e15574bda2dc8498d30a833 (diff) | |
download | linux-efc38dd7d5fa5c8cdd0c917c5d00947aa0539443.tar.bz2 |
mac80211: fix radiotap vendor presence bitmap handling
Due to the alignment handling, it actually matters where in the code
we add the 4 bytes for the presence bitmap to the length; the first
field is the timestamp with 8 byte alignment so we need to add the
space for the extra vendor namespace presence bitmap *before* we do
any alignment for the fields.
Move the presence bitmap length accounting to the right place to fix
the alignment for the data properly.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 8327440aa24b..c90904ce6e99 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -143,6 +143,9 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local, /* allocate extra bitmaps */ if (status->chains) len += 4 * hweight8(status->chains); + /* vendor presence bitmap */ + if (status->flag & RX_FLAG_RADIOTAP_VENDOR_DATA) + len += 4; if (ieee80211_have_rx_timestamp(status)) { len = ALIGN(len, 8); @@ -207,8 +210,6 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local, if (status->flag & RX_FLAG_RADIOTAP_VENDOR_DATA) { struct ieee80211_vendor_radiotap *rtap = (void *)skb->data; - /* vendor presence bitmap */ - len += 4; /* alignment for fixed 6-byte vendor data header */ len = ALIGN(len, 2); /* vendor data header */ |