mac80211: backport brcmfmac changes from 2016-07-08
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 309-cfg80211-fix-proto-in-ieee80211_data_to_8023-for-fra.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 29 Jun 2016 10:02:32 +0200
3 Subject: [PATCH] cfg80211: fix proto in ieee80211_data_to_8023 for frames
4 without LLC header
5
6 The PDU length of incoming LLC frames is set to the total skb payload size
7 in __ieee80211_data_to_8023() of net/wireless/util.c which incorrectly
8 includes the length of the IEEE 802.11 header.
9
10 The resulting LLC frame header has a too large PDU length, causing the
11 llc_fixup_skb() function of net/llc/llc_input.c to reject the incoming
12 skb, effectively breaking STP.
13
14 Solve the problem by properly substracting the IEEE 802.11 frame header size
15 from the PDU length, allowing the LLC processor to pick up the incoming
16 control messages.
17
18 Special thanks to Gerry Rozema for tracking down the regression and proposing
19 a suitable patch.
20
21 Fixes: 2d1c304cb2d5 ("cfg80211: add function for 802.3 conversion with separate output buffer")
22 Cc: stable@vger.kernel.org
23 Reported-by: Gerry Rozema <gerryr@rozeware.com>
24 Signed-off-by: Felix Fietkau <nbd@nbd.name>
25 ---
26
27 --- a/net/wireless/util.c
28 +++ b/net/wireless/util.c
29 @@ -509,7 +509,7 @@ static int __ieee80211_data_to_8023(stru
30 * replace EtherType */
31 hdrlen += ETH_ALEN + 2;
32 else
33 - tmp.h_proto = htons(skb->len);
34 + tmp.h_proto = htons(skb->len - hdrlen);
35
36 pskb_pull(skb, hdrlen);
37