OSDN Git Service

iwlwifi: mvm: fix RX SKB header size and align it properly
authorJohannes Berg <johannes.berg@intel.com>
Wed, 14 Dec 2016 12:48:04 +0000 (13:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:17:51 +0000 (09:17 +0100)
commit3efaebb3bbc1a5d702ed0a943b91cd14f78d0bab
treecc708c2e948a1887650966a6c6b734b1e491cc21
parent02db6c7024e15904e508070455cdefd1f73a859d
iwlwifi: mvm: fix RX SKB header size and align it properly

[ Upstream commit 5cddd05c9cbe420436799716d009bc0372ef8268 ]

When receiving a frame, we currently pull in sizeof(*hdr) plus
some extra (crypto/snap), which is too much, most headers aren't
actually sizeof(*hdr) since that takes into account the 4-address
format but doesn't take into account QoS. As a result, a typical
frame will have 4 bytes of the payload in the SKB header already.

Fix this by calculating the correct header length, and now that
we have that, align the end of the SKB header to a multiple of 4
so that the IP header will be aligned properly when pulled in.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/intel/iwlwifi/mvm/rx.c