mt76: fix encap offload ethernet type check
authorFelix Fietkau <nbd@nbd.name>
Wed, 20 Apr 2022 12:29:00 +0000 (14:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:37 +0000 (10:22 +0200)
commit4b6807b1cfb8677d8805a3fa9ee51d7d52d9eceb
tree7b88674a033dc0901a12d98c5a3cc122307b65a7
parentbf5572fb3fc42a72c4f9f71e67a11a5fd5ac00f8
mt76: fix encap offload ethernet type check

[ Upstream commit bc98e7fdd80d215b4b55eea001023231eb8ce12e ]

The driver needs to check if the format is 802.2 vs 802.3 in order to set
a tx descriptor flag. skb->protocol can't be used, since it may not be properly
initialized for packets coming in from a packet socket.
Fix misdetection by checking the ethertype from the skb data instead

Reported-by: Thibaut VARĂˆNE <hacks+kernel@slashdirt.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mac.c