diff options
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r-- | net/mac80211/key.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 6597c779e35a..a5b06fe71980 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -118,12 +118,12 @@ static const u8 *get_mac_for_key(struct ieee80211_key *key) | |||
118 | * address to indicate a transmit-only key. | 118 | * address to indicate a transmit-only key. |
119 | */ | 119 | */ |
120 | if (key->conf.alg != ALG_WEP && | 120 | if (key->conf.alg != ALG_WEP && |
121 | (key->sdata->vif.type == IEEE80211_IF_TYPE_AP || | 121 | (key->sdata->vif.type == NL80211_IFTYPE_AP || |
122 | key->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) | 122 | key->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) |
123 | addr = zero_addr; | 123 | addr = zero_addr; |
124 | 124 | ||
125 | if (key->sta) | 125 | if (key->sta) |
126 | addr = key->sta->addr; | 126 | addr = key->sta->sta.addr; |
127 | 127 | ||
128 | return addr; | 128 | return addr; |
129 | } | 129 | } |
@@ -281,6 +281,20 @@ struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg, | |||
281 | key->conf.alg = alg; | 281 | key->conf.alg = alg; |
282 | key->conf.keyidx = idx; | 282 | key->conf.keyidx = idx; |
283 | key->conf.keylen = key_len; | 283 | key->conf.keylen = key_len; |
284 | switch (alg) { | ||
285 | case ALG_WEP: | ||
286 | key->conf.iv_len = WEP_IV_LEN; | ||
287 | key->conf.icv_len = WEP_ICV_LEN; | ||
288 | break; | ||
289 | case ALG_TKIP: | ||
290 | key->conf.iv_len = TKIP_IV_LEN; | ||
291 | key->conf.icv_len = TKIP_ICV_LEN; | ||
292 | break; | ||
293 | case ALG_CCMP: | ||
294 | key->conf.iv_len = CCMP_HDR_LEN; | ||
295 | key->conf.icv_len = CCMP_MIC_LEN; | ||
296 | break; | ||
297 | } | ||
284 | memcpy(key->conf.key, key_data, key_len); | 298 | memcpy(key->conf.key, key_data, key_len); |
285 | INIT_LIST_HEAD(&key->list); | 299 | INIT_LIST_HEAD(&key->list); |
286 | INIT_LIST_HEAD(&key->todo); | 300 | INIT_LIST_HEAD(&key->todo); |
@@ -331,7 +345,7 @@ void ieee80211_key_link(struct ieee80211_key *key, | |||
331 | */ | 345 | */ |
332 | key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE; | 346 | key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE; |
333 | } else { | 347 | } else { |
334 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 348 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
335 | struct sta_info *ap; | 349 | struct sta_info *ap; |
336 | 350 | ||
337 | /* | 351 | /* |