mac80211: Fix headroom allocation when forwarding mesh pkt
authorCedric Izoard <Cedric.Izoard@ceva-dsp.com>
Wed, 11 Jan 2017 14:39:07 +0000 (14:39 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 11 Jan 2017 15:07:29 +0000 (16:07 +0100)
This patch fix issue introduced by my previous commit that
tried to ensure enough headroom was present, and instead
broke it.

When forwarding mesh pkt, mac80211 may also add security header,
and it must therefore be taken into account in the needed headroom.

Fixes: d8da0b5d64d5 ("mac80211: Ensure enough headroom when forwarding mesh pkt")
Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index c037c5bb6167fc228a273fae843b01c6e7170015..c87e61358b77b79e4a31843b2e8f98caeb1a724f 100644 (file)
@@ -2472,7 +2472,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
        if (!ifmsh->mshcfg.dot11MeshForwarding)
                goto out;
 
-       fwd_skb = skb_copy_expand(skb, local->tx_headroom, 0, GFP_ATOMIC);
+       fwd_skb = skb_copy_expand(skb, local->tx_headroom +
+                                      sdata->encrypt_headroom, 0, GFP_ATOMIC);
        if (!fwd_skb) {
                net_info_ratelimited("%s: failed to clone mesh frame\n",
                                    sdata->name);