diff mbox

RSN IBSS and GTK configuration

Message ID 20101205044415.GA12705@jm.kir.nu (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jouni Malinen Dec. 5, 2010, 4:44 a.m. UTC
None
diff mbox

Patch

--- wireless-testing.orig/net/mac80211/tx.c	2010-12-04 18:27:39.000000000 -0800
+++ wireless-testing/net/mac80211/tx.c	2010-12-04 18:53:13.000000000 -0800
@@ -539,14 +539,17 @@  ieee80211_tx_h_select_key(struct ieee802
 		 ieee80211_is_robust_mgmt_frame(hdr) &&
 		 (key = rcu_dereference(tx->sdata->default_mgmt_key)))
 		tx->key = key;
-	else if ((key = rcu_dereference(tx->sdata->default_key)))
+	else if ((key = rcu_dereference(tx->sdata->default_key))) {
 		tx->key = key;
-	else if (tx->sdata->drop_unencrypted &&
-		 (tx->skb->protocol != tx->sdata->control_port_protocol) &&
-		 !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
-		 (!ieee80211_is_robust_mgmt_frame(hdr) ||
-		  (ieee80211_is_action(hdr->frame_control) &&
-		   tx->sta && test_sta_flags(tx->sta, WLAN_STA_MFP)))) {
+		if (tx->sta && tx->sdata->vif.type == NL80211_IFTYPE_ADHOC &&
+		    tx->skb->protocol == tx->sdata->control_port_protocol)
+			tx->key = NULL;
+	} else if (tx->sdata->drop_unencrypted &&
+		   (tx->skb->protocol != tx->sdata->control_port_protocol) &&
+		   !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
+		   (!ieee80211_is_robust_mgmt_frame(hdr) ||
+		    (ieee80211_is_action(hdr->frame_control) &&
+		     tx->sta && test_sta_flags(tx->sta, WLAN_STA_MFP)))) {
 		I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
 		return TX_DROP;
 	} else