From patchwork Sun Dec 5 04:44:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 380561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB54iSum026323 for ; Sun, 5 Dec 2010 04:44:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752972Ab0LEEoW (ORCPT ); Sat, 4 Dec 2010 23:44:22 -0500 Received: from 128-177-27-249.ip.openhosting.com ([128.177.27.249]:51392 "EHLO jmalinen.user.openhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752813Ab0LEEoV (ORCPT ); Sat, 4 Dec 2010 23:44:21 -0500 Received: from jm (216.156.83.74.ptr.us.xo.net [216.156.83.74]) (authenticated bits=0) by jmalinen.user.openhosting.com (8.13.8/8.13.8) with ESMTP id oB54iGpc019096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 23:44:17 -0500 Received: by jm (sSMTP sendmail emulation); Sat, 04 Dec 2010 20:44:15 -0800 Date: Sat, 4 Dec 2010 20:44:15 -0800 From: Jouni Malinen To: Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: RSN IBSS and GTK configuration Message-ID: <20101205044415.GA12705@jm.kir.nu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 05 Dec 2010 04:44:29 +0000 (UTC) --- 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