From: Felix Fietkau Date: Sun, 10 Mar 2019 20:14:53 +0000 (+0100) Subject: mac80211: allocate tailroom for forwarded mesh packets X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=51e1092fae52f3b63b14f0c73306faba4ad71f53;p=openwrt%2Fstaging%2Fthess.git mac80211: allocate tailroom for forwarded mesh packets Fixes a warning + packet loss on encrypted mesh networks with forwarding Signed-off-by: Felix Fietkau --- diff --git a/package/kernel/mac80211/patches/subsys/302-mac80211-allocate-tailroom-for-forwarded-mesh-packet.patch b/package/kernel/mac80211/patches/subsys/302-mac80211-allocate-tailroom-for-forwarded-mesh-packet.patch new file mode 100644 index 0000000000..6db41daf45 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/302-mac80211-allocate-tailroom-for-forwarded-mesh-packet.patch @@ -0,0 +1,37 @@ +From: Felix Fietkau +Date: Fri, 22 Feb 2019 13:21:15 +0100 +Subject: [PATCH] mac80211: allocate tailroom for forwarded mesh packets + +Forwarded packets enter the tx path through ieee80211_add_pending_skb, +which skips the ieee80211_skb_resize call. +Fixes WARN_ON in ccmp_encrypt_skb and resulting packet loss. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2598,6 +2598,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; + u16 ac, q, hdrlen; ++ int tailroom = 0; + + hdr = (struct ieee80211_hdr *) skb->data; + hdrlen = ieee80211_hdrlen(hdr->frame_control); +@@ -2684,8 +2685,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + if (!ifmsh->mshcfg.dot11MeshForwarding) + goto out; + ++ if (sdata->crypto_tx_tailroom_needed_cnt) ++ tailroom = IEEE80211_ENCRYPT_TAILROOM; ++ + fwd_skb = skb_copy_expand(skb, local->tx_headroom + +- sdata->encrypt_headroom, 0, GFP_ATOMIC); ++ sdata->encrypt_headroom, ++ tailroom, GFP_ATOMIC); + if (!fwd_skb) + goto out; +