aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
blob: e2b268ae4c0e4fe6060d698fd9cebd312d9667b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 20 Feb 2023 12:50:50 +0100
Subject: [PATCH] mac80211: fix mesh forwarding

Linearize packets (needed for forwarding A-MSDU subframes).
Fix network header offset to fix flow dissector (and fair queueing).

Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---

--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2904,6 +2904,9 @@ ieee80211_rx_mesh_data(struct ieee80211_
 
 		if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
 			return RX_DROP_UNUSABLE;
+
+		if (skb_linearize(fwd_skb))
+			return RX_DROP_UNUSABLE;
 	}
 
 	fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
@@ -2918,7 +2921,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
 		hdrlen += ETH_ALEN;
 	else
 		fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
-	skb_set_network_header(fwd_skb, hdrlen);
+	skb_set_network_header(fwd_skb, hdrlen + 2);
 
 	info = IEEE80211_SKB_CB(fwd_skb);
 	memset(info, 0, sizeof(*info));