aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 915e77769312..dbf66b52d38c 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -31,6 +31,7 @@
31#include "mesh.h" 31#include "mesh.h"
32#include "wme.h" 32#include "wme.h"
33#include "led.h" 33#include "led.h"
34#include "wep.h"
34 35
35/* privid for wiphys to determine whether they belong to us or not */ 36/* privid for wiphys to determine whether they belong to us or not */
36void *mac80211_wiphy_privid = &mac80211_wiphy_privid; 37void *mac80211_wiphy_privid = &mac80211_wiphy_privid;
@@ -804,12 +805,13 @@ u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
804 805
805void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 806void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
806 u16 transaction, u16 auth_alg, 807 u16 transaction, u16 auth_alg,
807 u8 *extra, size_t extra_len, 808 u8 *extra, size_t extra_len, const u8 *bssid,
808 const u8 *bssid, int encrypt) 809 const u8 *key, u8 key_len, u8 key_idx)
809{ 810{
810 struct ieee80211_local *local = sdata->local; 811 struct ieee80211_local *local = sdata->local;
811 struct sk_buff *skb; 812 struct sk_buff *skb;
812 struct ieee80211_mgmt *mgmt; 813 struct ieee80211_mgmt *mgmt;
814 int err;
813 815
814 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 816 skb = dev_alloc_skb(local->hw.extra_tx_headroom +
815 sizeof(*mgmt) + 6 + extra_len); 817 sizeof(*mgmt) + 6 + extra_len);
@@ -824,8 +826,6 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
824 memset(mgmt, 0, 24 + 6); 826 memset(mgmt, 0, 24 + 6);
825 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 827 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
826 IEEE80211_STYPE_AUTH); 828 IEEE80211_STYPE_AUTH);
827 if (encrypt)
828 mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
829 memcpy(mgmt->da, bssid, ETH_ALEN); 829 memcpy(mgmt->da, bssid, ETH_ALEN);
830 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 830 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
831 memcpy(mgmt->bssid, bssid, ETH_ALEN); 831 memcpy(mgmt->bssid, bssid, ETH_ALEN);
@@ -835,7 +835,13 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
835 if (extra) 835 if (extra)
836 memcpy(skb_put(skb, extra_len), extra, extra_len); 836 memcpy(skb_put(skb, extra_len), extra, extra_len);
837 837
838 ieee80211_tx_skb(sdata, skb, encrypt); 838 if (auth_alg == WLAN_AUTH_SHARED_KEY && transaction == 3) {
839 mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
840 err = ieee80211_wep_encrypt(local, skb, key, key_len, key_idx);
841 WARN_ON(err);
842 }
843
844 ieee80211_tx_skb(sdata, skb, 0);
839} 845}
840 846
841int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 847int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,