Skip to contentSkip to conversation

wifi: cfg80211: fix receving mesh packets without RFC1042 header

PATCH Applied Felix Fietkau 3 participants 3 messages Jul 11, 2023 – Jul 13, 2023 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: cfg80211: fix receving mesh packets without RFC1042 header

Fix ethernet header length field after stripping the mesh header

Fixes 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
---
 net/wireless/util.c | 2 ++
 1 file changed, 2 insertions(+)
net/wireless/util.c +2 -0
index 89c9ad6c886e..1783ab9d57a3 100644
@@ -580,6 +580,8 @@ int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
 		hdrlen += ETH_ALEN + 2;
 	else if (!pskb_may_pull(skb, hdrlen))
 		return -EINVAL;
+	else
+		payload.eth.h_proto = htons(skb->len - hdrlen);
 
 	mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
 	switch (payload.flags & MESH_FLAGS_AE) {
Signature · 1 line
2.41.0
Tested-by on v1 1/1
#1 lore raw
Quoted 16 lines · Felix Fietkau

Fix ethernet header length field after stripping the mesh header

Fixes 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
---
 net/wireless/util.c | 2 ++
 1 file changed, 2 insertions(+)
net/wireless/util.c +0 -0
index 89c9ad6c886e..1783ab9d57a3 100644

net/wireless/util.c int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb) · line 587

Quoted 8 lines
net/wireless/util.c +2 -0
@@ -580,6 +580,8 @@ int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
 		hdrlen += ETH_ALEN + 2;
 	else if (!pskb_may_pull(skb, hdrlen))
 		return -EINVAL;
+	else
+		payload.eth.h_proto = htons(skb->len - hdrlen);
 
 	mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
 	switch (payload.flags & MESH_FLAGS_AE) {

I tested this on my side and everything works again, so if you want/need it:

#2 lore raw
In reply to Felix Fietkau
Quoted 7 lines · On Tue, 11 Jul 2023 13:50:52 +0200 Felix Fietkau wrote:

Fix ethernet header length field after stripping the mesh header

Fixes 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")

Applied, thanks!