diff options
Diffstat (limited to 'net/mac80211/wep.c')
-rw-r--r-- | net/mac80211/wep.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 3cbae42ec504..1e7f03dd8f6b 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -333,11 +333,16 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) | |||
333 | 333 | ||
334 | static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | 334 | static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) |
335 | { | 335 | { |
336 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
337 | |||
338 | info->control.iv_len = WEP_IV_LEN; | ||
339 | info->control.icv_len = WEP_ICV_LEN; | ||
340 | |||
336 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { | 341 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { |
342 | info->control.hw_key = &tx->key->conf; | ||
337 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) | 343 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) |
338 | return -1; | 344 | return -1; |
339 | } else { | 345 | } else { |
340 | tx->control->hw_key = &tx->key->conf; | ||
341 | if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) { | 346 | if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) { |
342 | if (!ieee80211_wep_add_iv(tx->local, skb, tx->key)) | 347 | if (!ieee80211_wep_add_iv(tx->local, skb, tx->key)) |
343 | return -1; | 348 | return -1; |
@@ -349,8 +354,6 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
349 | ieee80211_tx_result | 354 | ieee80211_tx_result |
350 | ieee80211_crypto_wep_encrypt(struct ieee80211_tx_data *tx) | 355 | ieee80211_crypto_wep_encrypt(struct ieee80211_tx_data *tx) |
351 | { | 356 | { |
352 | tx->control->iv_len = WEP_IV_LEN; | ||
353 | tx->control->icv_len = WEP_ICV_LEN; | ||
354 | ieee80211_tx_set_protected(tx); | 357 | ieee80211_tx_set_protected(tx); |
355 | 358 | ||
356 | if (wep_encrypt_skb(tx, tx->skb) < 0) { | 359 | if (wep_encrypt_skb(tx, tx->skb) < 0) { |