linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Pedersen <thomas@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: devel@lists.open80211s.org, Javier Cardona <javier@cozybit.com>
Subject: [PATCH 7/7] mac80211: Check auth status before attempting to establish a peer link
Date: Thu,  3 Mar 2011 19:11:47 -0800	[thread overview]
Message-ID: <1299208307-9428-8-git-send-email-thomas@cozybit.com> (raw)
In-Reply-To: <1299208307-9428-1-git-send-email-thomas@cozybit.com>

From: Javier Cardona <javier@cozybit.com>

Signed-off-by: Javier Cardona <javier@cozybit.com>
Tested-by: Thomas Pedersen <thomas@cozybit.com>
---
 net/mac80211/mesh_plink.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 5a845fd..a89a90e 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -378,6 +378,9 @@ int mesh_plink_open(struct sta_info *sta)
 	__le16 llid;
 	struct ieee80211_sub_if_data *sdata = sta->sdata;
 
+	if (!test_sta_flags(sta, WLAN_STA_AUTH))
+		return -EPERM;
+
 	spin_lock_bh(&sta->lock);
 	get_random_bytes(&llid, 2);
 	sta->llid = llid;
@@ -486,7 +489,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 		return;
 	}
 
-	if (sta && sta->plink_state == PLINK_BLOCKED) {
+	if (sta && (!test_sta_flags(sta, WLAN_STA_AUTH) ||
+					sta->plink_state == PLINK_BLOCKED)) {
+		mpl_dbg("Mesh plink: blocked or unauthenticated peer\n");
 		rcu_read_unlock();
 		return;
 	}
-- 
1.7.0.4


  parent reply	other threads:[~2011-03-04  3:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04  3:11 Thomas Pedersen
2011-03-04  3:11 ` [PATCH 1/7] mac80211: Support RSN information element on mesh interfaces Thomas Pedersen
2011-03-04 11:30   ` Johannes Berg
2011-03-04 18:48     ` Javier Cardona
2011-03-04  3:11 ` [PATCH 2/7] mac80211: New constant definitions for SAE Thomas Pedersen
2011-03-04 11:32   ` Johannes Berg
2011-03-04 18:51     ` Javier Cardona
2011-03-04  3:11 ` [PATCH 3/7] mac80211: Let user space receive and send mesh auth/deauth frames Thomas Pedersen
2011-03-04  3:11 ` [PATCH 4/7] mac80211: Accept mesh auth frames before a peer link has been established Thomas Pedersen
2011-03-04  3:11 ` [PATCH 5/7] nl80211: Let userspace set the authenticated flag for a mesh peer Thomas Pedersen
2011-03-04 11:36   ` Johannes Berg
2011-03-04 19:01     ` Javier Cardona
2011-03-04 19:14       ` Johannes Berg
2011-03-04  3:11 ` [PATCH 6/7] mac80211: Parse RSN information element to determine if a peer needs authentication Thomas Pedersen
2011-03-04 11:37   ` Johannes Berg
2011-03-04 19:06     ` Javier Cardona
2011-03-04 19:18       ` Johannes Berg
2011-03-04 19:45         ` Javier Cardona
2011-03-04 19:52           ` Johannes Berg
2011-03-04  3:11 ` Thomas Pedersen [this message]
2011-03-04 11:37   ` [PATCH 7/7] mac80211: Check auth status before attempting to establish a peer link Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1299208307-9428-8-git-send-email-thomas@cozybit.com \
    --to=thomas@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).