aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index cd6bc87eec73..50c6c4fabea5 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -330,6 +330,22 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)
330 return TX_CONTINUE; 330 return TX_CONTINUE;
331} 331}
332 332
333static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta,
334 struct sk_buff *skb)
335{
336 if (!ieee80211_is_mgmt(fc))
337 return 0;
338
339 if (sta == NULL || !test_sta_flags(sta, WLAN_STA_MFP))
340 return 0;
341
342 if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *)
343 skb->data))
344 return 0;
345
346 return 1;
347}
348
333static ieee80211_tx_result 349static ieee80211_tx_result
334ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) 350ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
335{ 351{
@@ -428,10 +444,15 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
428 if (ieee80211_is_auth(hdr->frame_control)) 444 if (ieee80211_is_auth(hdr->frame_control))
429 break; 445 break;
430 case ALG_TKIP: 446 case ALG_TKIP:
431 case ALG_CCMP:
432 if (!ieee80211_is_data_present(hdr->frame_control)) 447 if (!ieee80211_is_data_present(hdr->frame_control))
433 tx->key = NULL; 448 tx->key = NULL;
434 break; 449 break;
450 case ALG_CCMP:
451 if (!ieee80211_is_data_present(hdr->frame_control) &&
452 !ieee80211_use_mfp(hdr->frame_control, tx->sta,
453 tx->skb))
454 tx->key = NULL;
455 break;
435 } 456 }
436 } 457 }
437 458