summaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-02-11 12:52:51 +0100
committerIngo Molnar <mingo@kernel.org>2019-02-11 12:52:51 +0100
commitdc14b5fe7d0a1e37e9388964614676e4166b2953 (patch)
tree4f4f3aed094446b3e5daedd8710ccd831943490f /net/mac80211/tx.c
parentbae54dc4f353653bbd3e3081754adad05da1d4dd (diff)
parentd13937116f1e82bf508a6325111b322c30c85eb9 (diff)
downloadlinux-0-day-dc14b5fe7d0a1e37e9388964614676e4166b2953.tar.gz
linux-0-day-dc14b5fe7d0a1e37e9388964614676e4166b2953.tar.xz
Merge tag 'v5.0-rc6' into x86/fpu, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f170d6c6629a0..928f13a208b05 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1938,9 +1938,16 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
int head_need, bool may_encrypt)
{
struct ieee80211_local *local = sdata->local;
+ struct ieee80211_hdr *hdr;
+ bool enc_tailroom;
int tail_need = 0;
- if (may_encrypt && sdata->crypto_tx_tailroom_needed_cnt) {
+ hdr = (struct ieee80211_hdr *) skb->data;
+ enc_tailroom = may_encrypt &&
+ (sdata->crypto_tx_tailroom_needed_cnt ||
+ ieee80211_is_mgmt(hdr->frame_control));
+
+ if (enc_tailroom) {
tail_need = IEEE80211_ENCRYPT_TAILROOM;
tail_need -= skb_tailroom(skb);
tail_need = max_t(int, tail_need, 0);
@@ -1948,8 +1955,7 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
if (skb_cloned(skb) &&
(!ieee80211_hw_check(&local->hw, SUPPORTS_CLONED_SKBS) ||
- !skb_clone_writable(skb, ETH_HLEN) ||
- (may_encrypt && sdata->crypto_tx_tailroom_needed_cnt)))
+ !skb_clone_writable(skb, ETH_HLEN) || enc_tailroom))
I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
else if (head_need || tail_need)
I802_DEBUG_INC(local->tx_expand_skb_head);