diff options
Diffstat (limited to 'net/mac80211/wep.c')
| -rw-r--r-- | net/mac80211/wep.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 247123fe1a7a..5d745f2d7236 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
| @@ -305,20 +305,19 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
| 305 | { | 305 | { |
| 306 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 306 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 307 | 307 | ||
| 308 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { | 308 | if (!info->control.hw_key) { |
| 309 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key->conf.key, | 309 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key->conf.key, |
| 310 | tx->key->conf.keylen, | 310 | tx->key->conf.keylen, |
| 311 | tx->key->conf.keyidx)) | 311 | tx->key->conf.keyidx)) |
| 312 | return -1; | 312 | return -1; |
| 313 | } else { | 313 | } else if (info->control.hw_key->flags & |
| 314 | info->control.hw_key = &tx->key->conf; | 314 | IEEE80211_KEY_FLAG_GENERATE_IV) { |
| 315 | if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) { | 315 | if (!ieee80211_wep_add_iv(tx->local, skb, |
| 316 | if (!ieee80211_wep_add_iv(tx->local, skb, | 316 | tx->key->conf.keylen, |
| 317 | tx->key->conf.keylen, | 317 | tx->key->conf.keyidx)) |
| 318 | tx->key->conf.keyidx)) | 318 | return -1; |
| 319 | return -1; | ||
| 320 | } | ||
| 321 | } | 319 | } |
| 320 | |||
| 322 | return 0; | 321 | return 0; |
| 323 | } | 322 | } |
| 324 | 323 | ||
