mt76: fix encap offload ethernet type check
authorFelix Fietkau <nbd@nbd.name>
Wed, 20 Apr 2022 12:29:00 +0000 (14:29 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 May 2022 07:39:35 +0000 (09:39 +0200)
commitbc98e7fdd80d215b4b55eea001023231eb8ce12e
treeda3000cf9602ff2d50e630b2b6eee1e744af4012
parent3968a66475b40691c37b5e6c76975f699671e10e
mt76: fix encap offload ethernet type check

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>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mac.c