Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277603
b: refs/heads/master
c: ec3cbb9
h: refs/heads/master
i:
  277601: 3044c51
  277599: df088e8
v: v3
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Nov 8, 2011
1 parent 0547c40 commit 4c73938
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: 48ef5c427ac2cfd12c150b38263d3ebb0d989647
refs/heads/master: ec3cbb9ce241da90b9d43e49996fae5082c6b6f7
9 changes: 8 additions & 1 deletion trunk/drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ struct ndis_80211_pmkid {
#define RNDIS_WLAN_ALG_TKIP (1<<1)
#define RNDIS_WLAN_ALG_CCMP (1<<2)

#define RNDIS_WLAN_NUM_KEYS 4
#define RNDIS_WLAN_KEY_MGMT_NONE 0
#define RNDIS_WLAN_KEY_MGMT_802_1X (1<<0)
#define RNDIS_WLAN_KEY_MGMT_PSK (1<<1)
Expand Down Expand Up @@ -516,7 +517,7 @@ struct rndis_wlan_private {

/* encryption stuff */
int encr_tx_key_index;
struct rndis_wlan_encr_key encr_keys[4];
struct rndis_wlan_encr_key encr_keys[RNDIS_WLAN_NUM_KEYS];
int wpa_version;

u8 command_buffer[COMMAND_BUFFER_SIZE];
Expand Down Expand Up @@ -1535,6 +1536,9 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid)
bool is_wpa;
int ret;

if (index >= RNDIS_WLAN_NUM_KEYS)
return -ENOENT;

if (priv->encr_keys[index].len == 0)
return 0;

Expand Down Expand Up @@ -2451,6 +2455,9 @@ static int rndis_set_default_key(struct wiphy *wiphy, struct net_device *netdev,

netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index);

if (key_index >= RNDIS_WLAN_NUM_KEYS)
return -ENOENT;

priv->encr_tx_key_index = key_index;

if (is_wpa_key(priv, key_index))
Expand Down

0 comments on commit 4c73938

Please sign in to comment.