2b7579b24e499af263ec4824aa8558b19c024221
[openwrt/staging/hauke.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 21 Aug 2020 06:03:45 +0200
3 Subject: [PATCH] mac80211: set info->control.hw_key for encap offload
4 packets
5
6 This is needed for drivers that don't do the key lookup themselves
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
11 --- a/net/mac80211/tx.c
12 +++ b/net/mac80211/tx.c
13 @@ -4191,6 +4191,7 @@ static void ieee80211_8023_xmit(struct i
14 {
15 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
16 struct ieee80211_local *local = sdata->local;
17 + struct ieee80211_key *key;
18 struct tid_ampdu_tx *tid_tx;
19 u8 tid;
20
21 @@ -4239,6 +4240,10 @@ static void ieee80211_8023_xmit(struct i
22 info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP;
23 info->control.vif = &sdata->vif;
24
25 + key = rcu_dereference(sta->ptk[sta->ptk_idx]);
26 + if (key)
27 + info->control.hw_key = &key->conf;
28 +
29 ieee80211_tx_8023(sdata, skb, skb->len, sta, false);
30
31 return;