From patchwork Tue May 3 23:57:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 752312 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 p43NvhhI031181 for ; Tue, 3 May 2011 23:57:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754666Ab1ECX5l (ORCPT ); Tue, 3 May 2011 19:57:41 -0400 Received: from mail-px0-f170.google.com ([209.85.212.170]:51390 "EHLO mail-px0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754602Ab1ECX5j (ORCPT ); Tue, 3 May 2011 19:57:39 -0400 Received: by mail-px0-f170.google.com with SMTP id 19so426563pxi.1 for ; Tue, 03 May 2011 16:57:39 -0700 (PDT) Received: by 10.68.46.65 with SMTP id t1mr642334pbm.231.1304467058974; Tue, 03 May 2011 16:57:38 -0700 (PDT) Received: from localhost.localdomain ([99.8.184.170]) by mx.google.com with ESMTPS id z3sm344013pbk.55.2011.05.03.16.57.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2011 16:57:38 -0700 (PDT) From: Javier Cardona To: "John W. Linville" Cc: Thomas Pedersen , Javier Cardona , devel@lists.open80211s.org, Johannes Berg , linux-wireless@vger.kernel.org, jlopex@gmail.com Subject: [PATCH 06/13] nl80211: allow installing keys for a meshif Date: Tue, 3 May 2011 16:57:12 -0700 Message-Id: <1304467039-7730-7-git-send-email-javier@cozybit.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1304467039-7730-1-git-send-email-javier@cozybit.com> References: <1304467039-7730-1-git-send-email-javier@cozybit.com> 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 03 May 2011 23:57:45 +0000 (UTC) From: Thomas Pedersen Signed-off-by: Thomas Pedersen Signed-off-by: Javier Cardona --- net/mac80211/cfg.c | 5 ++++- net/wireless/nl80211.c | 1 + 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index dbc5bcb..852cb85 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -136,7 +136,10 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, mutex_lock(&sdata->local->sta_mtx); if (mac_addr) { - sta = sta_info_get_bss(sdata, mac_addr); + if (ieee80211_vif_is_mesh(&sdata->vif)) + sta = sta_info_get(sdata, mac_addr); + else + sta = sta_info_get_bss(sdata, mac_addr); if (!sta) { ieee80211_key_free(sdata->local, key); err = -ENOENT; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 49f220a..176d118 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -535,6 +535,7 @@ static int nl80211_key_allowed(struct wireless_dev *wdev) case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_P2P_GO: + case NL80211_IFTYPE_MESH_POINT: break; case NL80211_IFTYPE_ADHOC: if (!wdev->current_bss)