cb5a98631239413e4d3125d06bf3e28db04f0fb0
[openwrt/staging/neocturne.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 @@ -4185,6 +4185,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 @@ -4233,6 +4234,10 @@ static void ieee80211_8023_xmit(struct i
22 info->control.flags |= IEEE80211_TX_CTRL_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;