linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5] mac80211: fix key restricted/open display
@ 2007-03-16  3:28 Hong Liu
  2007-03-16 17:28 ` Michael Wu
  0 siblings, 1 reply; 11+ messages in thread
From: Hong Liu @ 2007-03-16  3:28 UTC (permalink / raw)
  To: Jiri Benc, John W. Linville; +Cc: linux-wireless


Signed-off-by: Hong Liu <hong.liu@intel.com>

---

 net/mac80211/ieee80211_ioctl.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

26742fdf9c5835a0abcb75a364840beee08953f8
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index f57e48f..46fd125 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -2934,6 +2934,14 @@ static int ieee80211_ioctl_siwencode(str
 	else
 		idx--;
 
+	if (erq->flags & (IW_ENCODE_OPEN | IW_ENCODE_RESTRICTED))
+		if (sdata->type == IEEE80211_IF_TYPE_STA ||
+		    sdata->type == IEEE80211_IF_TYPE_IBSS)
+			sdata->u.sta.auth_algs =
+				(erq->flags & IW_ENCODE_RESTRICTED) ?
+				IEEE80211_AUTH_ALG_SHARED_KEY :
+				IEEE80211_AUTH_ALG_OPEN;
+
 	if (erq->flags & IW_ENCODE_DISABLED)
 		alg = ALG_NONE;
 	else if (erq->length == 0) {
@@ -2993,6 +3001,14 @@ static int ieee80211_ioctl_giwencode(str
 	erq->length = sdata->keys[idx]->keylen;
 	erq->flags |= IW_ENCODE_ENABLED;
 
+	if (sdata->type == IEEE80211_IF_TYPE_STA ||
+	    sdata->type == IEEE80211_IF_TYPE_IBSS) {
+		if (sdata->u.sta.auth_algs & IEEE80211_AUTH_ALG_OPEN)
+			erq->flags |= IW_ENCODE_OPEN;
+		else if (sdata->u.sta.auth_algs & IEEE80211_AUTH_ALG_SHARED_KEY)
+			erq->flags |= IW_ENCODE_RESTRICTED;
+	}
+
 	return 0;
 }
 
-- 
1.3.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-23 18:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-16  3:28 [PATCH 3/5] mac80211: fix key restricted/open display Hong Liu
2007-03-16 17:28 ` Michael Wu
2007-03-17  3:46   ` Dan Williams
2007-03-17  3:57     ` Michael Wu
2007-03-17  4:38       ` Dan Williams
2007-03-17  4:57         ` Michael Wu
2007-03-17 17:23           ` Dan Williams
2007-03-18 16:45     ` Jouni Malinen
2007-03-18 23:35       ` Dan Williams
2007-03-22  3:43         ` Hong Liu
2007-03-23 18:27           ` Jiri Benc

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).