Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10255
b: refs/heads/master
c: ccd0fda
h: refs/heads/master
i:
  10253: c268936
  10251: 89053c6
  10247: c7e755f
  10239: 12a7403
v: v3
  • Loading branch information
James Ketrenos authored and Jeff Garzik committed Sep 22, 2005
1 parent 1e82df2 commit 0f1180e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42c94e43be27f8b9be9b5be491bae8af05e54dbd
refs/heads/master: ccd0fda3a6d9186d067893114f65b8df758d5a1f
3 changes: 3 additions & 0 deletions trunk/include/net/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,9 @@ struct ieee80211_device {
int host_encrypt;
int host_encrypt_msdu;
int host_decrypt;
/* host performs multicast decryption */
int host_mc_decrypt;

int host_open_frag;
int ieee802_1x; /* is IEEE 802.1X used */

Expand Down
2 changes: 2 additions & 0 deletions trunk/net/ieee80211/ieee80211_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
/* Default to enabling full open WEP with host based encrypt/decrypt */
ieee->host_encrypt = 1;
ieee->host_decrypt = 1;
ieee->host_mc_decrypt = 1;

/* Host fragementation in Open mode. Default is enabled.
* Note: host fragmentation is always enabled if host encryption
* is enabled. For cards can do hardware encryption, they must do
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/ieee80211/ieee80211_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
return 1;
}

if (ieee->host_decrypt) {
if (is_multicast_ether_addr(hdr->addr1) ? ieee->host_mc_decrypt :
ieee->host_decrypt) {
int idx = 0;
if (skb->len >= hdrlen + 3)
idx = skb->data[hdrlen + 3] >> 6;
Expand Down Expand Up @@ -1066,7 +1067,7 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
network->flags = 0;
network->atim_window = 0;
network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ?
0x3 : 0x0;
0x3 : 0x0;

if (stats->freq == IEEE80211_52GHZ_BAND) {
/* for A band (No DS info) */
Expand Down
13 changes: 10 additions & 3 deletions trunk/net/ieee80211/ieee80211_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int i, idx, ret = 0;
int group_key = 0;
const char *alg, *module;
struct ieee80211_crypto_ops *ops;
struct ieee80211_crypt_data **crypt;
Expand All @@ -509,9 +510,10 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
} else
idx = ieee->tx_keyidx;

if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
crypt = &ieee->crypt[idx];
else {
group_key = 1;
} else {
if (idx != 0)
return -EINVAL;
if (ieee->iw_mode == IW_MODE_INFRA)
Expand Down Expand Up @@ -542,7 +544,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
sec.enabled = 1;
sec.encrypt = 1;

if (!(ieee->host_encrypt || ieee->host_decrypt))
if (group_key ? !ieee->host_mc_decrypt :
!(ieee->host_encrypt || ieee->host_decrypt ||
ieee->host_encrypt_msdu))
goto skip_host_crypt;

switch (ext->alg) {
Expand Down Expand Up @@ -632,6 +636,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_3;
}
/* Don't set sec level for group keys. */
if (group_key)
sec.flags &= ~SEC_LEVEL;
}
done:
if (ieee->set_security)
Expand Down

0 comments on commit 0f1180e

Please sign in to comment.