Search Linux Wireless

[PATCH 3/5] mac80211: fix key restricted/open display

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---

 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

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux